HomeScript icon indicating copy to clipboard operation
HomeScript copied to clipboard

Incomplete list of Accessories?

Open samus-homebridge opened this issue 4 years ago • 2 comments

First of all, thank you very much for this project!

I am a new user of Homebridge and Homescript. I have recently installed a Nest thermostat and I'm working on a way of automating the hot water activation by way of readings received from a wireless temperature sensor attached to my hot water cylinder.

My Homebridge installation, with Homebridge-nest plugin, displays four Accessories in the web interface: the thermostat itself, Eco Mode, Hot Water and Home Occupied. However, when I run hs.py -l, only the thermostat and the Home Occupied Accessories are listed. I don't really care about Eco Mode, but I need to be able to see the Hot Water Accessory.

Any ideas why that one is not appearing through Homescript?

EDIT:

So I have done some more digging. I think the reason the Eco Mode and Hot Water are not showing up is because they are not their own Accessories as defined within Homebridge-nest. Rather, they are added as services to the thermostat Accessory if the appropriate booleans are set.

Within Homescript, in the getAccessories function it only parses "item['services'][1]' whereas in my installation, Eco mode appears to be item['services'][2] and hot water appears to be item['services'][2].

(Separately, I noticed when parsing from ['characteristics'][1] onward, it misses out ['characteristics'][0] (by definition) which is the current thermostat heating/cooling state. is it necessary to skip that for any reason?)

samus-homebridge avatar Jul 03 '21 16:07 samus-homebridge

Bit of a late reply here, but nevertheless:

it only parses "item['services'][1]' whereas in my installation, Eco mode appears to be item['services'][2] and hot water appears to be item['services'][2].

Thank you for pointing out this flaw. You're free to open a pull request resolving the same, or else, please provide your debug log so that I or someone else may be able to resolve this.

it misses out ['characteristics'][0] (by definition) which is the current thermostat heating/cooling state. is it necessary to skip that for any reason?

Most accessory lists that I've seen so far haven't had any useful information at ['characteristics'][0], which is why it's left out. But now that you mention it, lets have a look at your debug log to see if we need to rethink this decision.

menahishayan avatar Oct 18 '21 09:10 menahishayan

Of course, thanks. What command makes the best sense to send a log for? I ran "-l all" and it gave me this debug log but it doesn't show the DHW - I think I found out the above while tinkering with my own script which I seem to have lost.

samus-homebridge avatar Nov 26 '21 16:11 samus-homebridge