nebulous / infinitude

Open control of Carrier/Bryant thermostats
MIT License
225 stars 50 forks source link

Use of /api/config/<path> for array of elements #65

Closed sbrown4 closed 5 years ago

sbrown4 commented 5 years ago

I understand how to use this for setting things like /api/config?blight=70.. But, is there a path to change a value in config zones zone[0]. Can I specify the the change specifying the id attribute of zone?

If this needs additional implementation, what would be the approach? Maybe something like /config/zones/zone/0? Currently, this fails.

nebulous commented 5 years ago

Check out the api documentation if you haven't yet: https://github.com/nebulous/infinitude/wiki/Infinitude-API-calls

Can you give an example of something that you'd like to change in a zone that doesn't presently work?

sbrown4 commented 5 years ago

What's the syntax for changing the in zone 0 from 'off' to 'on'?

I'm probably missing something obvious. But, how do you select the zone?

sbrown4 commented 5 years ago

Maybe to be more clear:

/api/config?blight=70 works as expected.

This is a great feature that isn't suggested in the api wiki. I saw this in the code.

But, I can't figure out what syntax to use to access one of multiple zones.

nebulous commented 5 years ago

Ah, I see. f6926fa59e should allow traversal of lists as well.

For instance to set the temperature setback offset for zone 1 (usually only available from the service menu on the stat) to minus 1 degree:

/api/config/zones/zone/0/?tempoffset=-1

the zones are zero-indexed so zone/0/ is the first zone.

To get the first zone's setback setting: http://localhost/api/config/zones/zone/0/setback To set the first zone's setback setting to on: http://localhost/api/config/zones/zone/0/?setback=on