cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 39 forks source link

How to send multiple characteristics like "Active" & "inUse" for Valve to homebridge/to/set ? #85

Closed IoTPlay closed 4 years ago

IoTPlay commented 4 years ago

Hi, for instance, the service Valve has 3 x required characteristics: Active, ValveType, and inUse. I got Active to work, but how can I send Active, and inUse in one message?

{"name":"ESP62.Switch.Relay1","service_name":"Sprinkler Leg-1","characteristic":"Active","value":"1"}
IoTPlay commented 4 years ago

This fails to send to mqtt homebridge/to/set :

{"name":"ESP62.Switch.Relay1","service_name":"Sprinkler Leg-1","characteristic":"inUse","value":"1"}
cflurin commented 4 years ago

but how can I send Active, and inUse in one message?

You have to send a message for every characteristic.

This fails to send to mqtt homebridge/to/set :

Depending on the characteristic you have to use the corresponding format.

format: Formats.UINT8,

{"name":"ESP62.Switch.Relay1","service_name":"Sprinkler Leg-1","characteristic":"InUse","value":1}

See:

https://github.com/KhaosT/HAP-NodeJS/blob/master/src/lib/gen/HomeKit.ts

cflurin commented 4 years ago

Also replace inUse by InUse.

IoTPlay commented 4 years ago

Excellent, all working now, thanks.