Jump to content
c4forums | The Control4 Community

XML Programming - Just a thought?


Recommended Posts

Theoretically, would it be possible to backup a project to a c4p, open the xml file and make changes such as adding a device, or is there another place data is stored as well? Would this be the "legal" way to do more programming than composer HE allows? I was just thinking about this the other day and was curious.

Link to comment
Share on other sites


It's certainly *possible* to make changes 'offline' to your project's XML.

 

It's also certainly not recommended.  It's a bit more involved than just adding the driver item XML to the project, there are also bindings, which are notoriously difficult to make correctly in the XML.

 

Obviously, there's no warranty if you screw up your project, and if things do 'go pear shaped', as they like to say in the UK, you don't have much if any recourse to fix it.

 

RyanE

Link to comment
Share on other sites

That's RyanE, that's what I figured.  I have everything set up in the XML at this point for the driver and it shows up in my project, but you're right, the bindings are the difficult part! I do think it is fun (since I do a lot of coding everyday) to see the XML and get it right.  I always make backups before I change anything  :)

 

With that in mind, is there only two places where a 7 inch infinity edge touchscreen is referenced in a project (for just a simple install - no programming)? That's what I see for my SR-250 remote... Anyway, I am trying to do the network binding based on the other devices in the project, but I still seem to get an error when I try to reload the project.  Here is the XML of my network bindings (formatted for easier reading) with my comments/questions below (I replaced MAC address numbers with #'s):

<networkbindings><networkbinding><deviceid>8</deviceid><networkbindingid>6001</networkbindingid><addresstype>1</addresstype><addr>127.0.0.1</addr><uuid>c4:control4_hc800_homecontroller-home-controller-###-############</uuid><ssdptype>c4:control4_hc800_homecontroller</ssdptype><status>online</status></networkbinding><networkbinding><deviceid>13</deviceid><networkbindingid>6001</networkbindingid><addresstype>1</addresstype><addr>10.0.1.79</addr><uuid>uuid:##-##-##-##-##-##</uuid><ssdptype>c4:v1_8chanamp:c4-8AMP1-B</ssdptype><status>offline</status></networkbinding><networkbinding><deviceid>57</deviceid><networkbindingid>6001</networkbindingid><addresstype>3</addresstype><addr>################</addr><uuid>################</uuid><ssdptype>c4:control4_keypad:C4-KP6-Z</ssdptype><status>online</status></networkbinding><networkbinding><deviceid>89</deviceid><networkbindingid>6001</networkbindingid><addresstype>3</addresstype><addr>################</addr><uuid>################</uuid><ssdptype>c4:control4_sr250b:C4-SR250B</ssdptype><status>online</status></networkbinding></networkbindings>

~ deviceid - declared earlier in the XML file for the driver, so that's not a problem

~ networkbindingid - not sure exactly what this is, but it is 6001 for all other devices, so I assume the touchscreen should be the same

~ addresstype - This has something to do with whether it's zigbee, a UUID, or IP address I assume.  I should use IP address for the touchscreen since it's wifi connected.  As for the uuid, I should format it SSDPTYPE-UUID as the home controller?

~ SSDP type - I have this... it shows in one of the network tools, can't remember which one

~ Status - Not sure if I should put online, offline, or leave it out.

 

Also, I'm not sure if I need any other properties for this in the network bindings area or elsewhere.  If anyone knows the answer to this or could provide a sample XML file I would greatly appreciate it.  I couldn't seem to find any sample c4p files or XML sample code, and I think it could be a good resource for the more code savvy people on here.

Link to comment
Share on other sites

Not necessarily you :)

I actually got it to work nicely. The biggest challenge was getting composer he to accept the updated c4p. I figured out you can't extract all and rezip. It won't work. You have to change the project.xml in the zip and just rename. Just for anyone else reading this.

Link to comment
Share on other sites

Not sure if you think I'm going to help you doing this or not, but if you think so, you're mistaken.

:)

RyanE

But we know you want to, all programmers have a bit of hacker in them and like the "geek" factor of figuring something like this out.

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...