RavenSystem / esp-homekit-devices

Advanced firmware to add native Apple HomeKit and custom configurations, compatible with any SoC based on ESP32, ESP32-S, ESP32-C and ESP8266 series. (Shelly, Sonoff, Electrodragon, Tuya...)
Other
2.72k stars 357 forks source link

HAA Templates page not up to date with HAA v0.0.6 #495

Closed macjl closed 5 years ago

macjl commented 5 years ago

Hello,

The Wiki page of HAA templates seems not up to date with the new release of HAA v0.0.6 : https://github.com/RavenSystem/esp-homekit-devices/releases https://github.com/RavenSystem/esp-homekit-devices/wiki/HAA-Templates

I'm trying to install a new Sonoff Basic with this JSON inspired from Templates, and it doesn't work : {"c":{"l":13,"i":1},"a":[{"t":1,"r":[{"g":12}],"b":[{"g":0,"p":1,"t":1},{"g":2,"p":1,"t":1}]}]}

Regards

RavenSystem commented 5 years ago

https://twitter.com/RavenSystem/status/1169017948591329281

macjl commented 5 years ago

Thanks for your quick reply. Is there a way to downgrade to the v0.0.5 release to be able to use old configs?

macjl commented 5 years ago

Hello,

I was finally able to produce a valid JSon for 0.0.6 by analysing the code. Here it is : {"c":{"l":13,"i":1},"h":[{"t":1,"a":{"0":{"r":[{"g":12,"v":0}]},"1":{"r":[{"g":12,"v":1}]}},"b":[{"g":0},{"g":2}]}]} => Sonoff Basic with button on GPIO 2 and GPIO 0, and Relay on GPIO 12.

I could suggest to change this sentence in documentation :

"a" Actions: Actions performed on each state of the accessory. Are defined by a integer number.

I search long time to understand what it means. And in the source code, it's commented as an array which confuses me a lot. But it's just a list of states. Why not :

"a" Actions: List of actions performed on relays, at each state of accessory. Are defined by a integer number starting at 0.

macjl commented 5 years ago

And if someone want the the Sonoff S20 example with new JSon format:

Sonoff S20/S26 without UART output, with status LED and working button: {"c":{"l":13,"i":1},"h":[{"t":2,"a":{"0":{"r":[{"g":12,"v":0}]},"1":{"r":[{"g":12,"v":1}]}},"b":[{"g":0}]}]}

hejsiri commented 5 years ago

I need a template for sonoff touch t1 2 channel with new Json format. Can You help me?

hejsiri commented 5 years ago

"h": "v": What is this parametr?

macjl commented 5 years ago

From Wiki :

"h" HomeKit Accessories This section is mandatory. It contains an array of HomeKit accessories.

"v": Value: 0: Low, normally off. 1: High, normally on.

hejsiri commented 5 years ago

There was a small commotion. Is now the description of HAA Templates https://github.com/RavenSystem/esp-homekit-devices/wiki/HAA-Templates and the description https://github.com/RavenSystem/esp-homekit-devices/wiki/Home-Accessory-Architect is compatible with HAA version 0.0.7?

RavenSystem commented 5 years ago

There was a small commotion. Is now the description of HAA Templates https://github.com/RavenSystem/esp-homekit-devices/wiki/HAA-Templates and the description https://github.com/RavenSystem/esp-homekit-devices/wiki/Home-Accessory-Architect is compatible with HAA version 0.0.7?

Yes.

RavenSystem commented 5 years ago

All documentation is updated.