Relatively new HA user switching from Smartthings. I have a number of ZWave light switches and water turn off valves that I’m having difficulty with using OpenZwave, Zwave2Mqtt or Zwave beta – basically a number of my sensors either don’t update or show dead all the time. Never having issues with Smartthings I was wanting to find a solution for Zwave but local. Tried Domoticz and everything worked immediately, fast and no issues at all.
So I’d like to use Domoticz for my Zwave sensors and tie them back into Home Assistant. What I can’t figure out is how to properly update the state of the switches in HA. I can turn the lights on and off from HA and the domoticz will be basically headless but problem is when someone uses the actual wall switches; I then lose state.
In HA configuration.yaml I created a channel called k_light:
switch:
- platform: command_line
switches:
k_light:
command_on: 'curl "http://192.168.1.190:8888/json.htm?type=command¶m=switchlight&idx=5&switchcmd=On"'
command_off: 'curl "http://192.168.1.190:8888/json.htm?type=command¶m=switchlight&idx=5&switchcmd=Off"'
This triggers the light when I hit the lightening bolt on/off state.
Then I added:
customize:
switch.k_light:
assumed_state: false
This turned the switch into a sliding switch like they are when running zwave directly in HA.
In Domoticz a mqtt message is sent back to HA mosquitto and I found a automation to turn this into cleaner per sensor mqtt
home/sensor/5/switch
with a value of 1 for on and 0 for off.
How do I take the mqtt data and set the state of the switch to be on when 1 and off when 0. Should I be doing this in an automation or via state in mqtt. I’m just not sure how to merge all of this together to make it work.
I’m open to all suggestions (or criticisms) as I’m learning.
P.s. I’m not committed to domoticz if other suggestions on how to get zwave working properly. Using a Zooz USB stick for Zwave and it’s just night and day difference in operation when connected to domoticz vs HA.