GithubHelp home page GithubHelp logo

Comments (10)

pbathuk avatar pbathuk commented on May 30, 2024

Actually following a HA reboot the light one is not working... It does change the lights but always reverts to off not the state it actually is :(

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 30, 2024

Hi @pbathuk . Thanks for this, the HAss MQTT auto-discovery is the hottest feature on the todo list. I have made some checks and I think we should take inspiration from zegbee2mqtt home assistant integration. Zegbee is really similar to zwave and I think it can be made work

from zwave2mqtt.

pbathuk avatar pbathuk commented on May 30, 2024

Out of curiosity, is it best, or should I say more advisable to us value only or JSON (full or timestamp) for Mqtt? I see that for zigbee2mqtt they mention Json payload quite alot. Which I assume means the full JSON standard in z-wave?
I only ask so that I can try to mirror and find what works / does not.
Currently I use value only

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 30, 2024

I don't understand what you mean with your question. When a value change is detected in zwave network there should be a function like the discover that compose the MQTT message with a JSON payload and the correct topic to send the update to HAss, the payload HAss expect must respect the HAss specification for MQTT auto-discovery, it changes based on the device type. Try to check the previous link and the MQTT-Auto discovery specs.

from zwave2mqtt.

pbathuk avatar pbathuk commented on May 30, 2024

Sorry, I mean from a config on the openzwave panel, there is the option for the gateway to store in Mqtt as:

Just value
JSON timevalue
Entire z-wave JSON payload

I'm just wondering, from a dev point of view which you believe may work.. I'm assuming on the JSON types to match the expected JSON input to HA.

Will have a full read of the specs again and try some things

from zwave2mqtt.

pbathuk avatar pbathuk commented on May 30, 2024

Sorry accidentally clicked close on my phone

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 30, 2024

To make it working you can't use that, we must create a new one

from zwave2mqtt.

pbathuk avatar pbathuk commented on May 30, 2024

Ah ok, so in theory you are thinking:
{Prefix}/{node_id}/status
Or something like that
And that would hold the HA required JSON values to use in the auto discovery?
Only asking out of curiosity rather than how it will actually be done.

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 30, 2024

Yep something like that, need to study how to map devices and devices values into Hass devices configurations.

from zwave2mqtt.

pbathuk avatar pbathuk commented on May 30, 2024

So 1 final update on this:

I have code that now works for reporting the state of the light, its a little hacky as I am using the Attributes only option & it appears HA reads the value true in as 'true' therefore causing no end of issues. After setting up a second dev instance of HA so I can reboot the docker etc I finally have :

{ "name": "In_wall_study_switch", "command_topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-Mos_mqtt/api/setValue/set", "availability_topic": "zwave/Study/21/status", "brightness_command_topic": "zwave/Study/21/38/1/0/set", "brightness_state_topic": "zwave/Study/21/38/1/0", "payload_on": "{ \"args\":[21,37,1,0,true]}", "payload_off": "{ \"args\":[21,37,1,0,false]}", "state_topic": "zwave/Study/21/37/1/0", "state_value_template": "{% if value.replace(\"'\",'') == true %}{ \"args\":[21,37,1,0,true]}{% else %}{ \"args\":[21,37,1,0,false]}{% endif %}", "brightness_scale": 99, "qos": 2, "retain": false, "payload_available": "true", "payload_not_available": "false", "unique_id": "study_switch_111", "on_command_type": "first", "device": { "identifiers": "inwallstudyswitch111", "name": "in_wall_study_switch1", "sw_version": "1", "model": "Zwave", "manufacturer": "" } }

This is working robustly for me and I can see if the light is on as well as the brightness.

from zwave2mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.