Thanks a lot for a hint. I did managed to get this to work now by creating two Automations (one to switch ON and the other to switch OFF my light):
- id: '1591078797227'
alias: Office Light ON
description: ''
trigger:
- platform: mqtt
topic: OpenZWave/1/node/27/instance/1/commandclass/91/value/562950412091412/
condition:
- condition: device
device_id: e551af299a804b07bbbbcbb1bde2530a
domain: switch
entity_id: switch.zw175_smart_switch_7_switch
type: is_off
action:
- device_id: e551af299a804b07bbbbcbb1bde2530a
domain: switch
entity_id: switch.zw175_smart_switch_7_switch
type: turn_on
- id: '1591097653942'
alias: Office Light OFF
description: ''
trigger:
- platform: mqtt
topic: OpenZWave/1/node/27/instance/1/commandclass/91/value/562950412091412/
condition:
- condition: device
device_id: e551af299a804b07bbbbcbb1bde2530a
domain: switch
entity_id: switch.zw175_smart_switch_7_switch
type: is_on
action:
- device_id: e551af299a804b07bbbbcbb1bde2530a
domain: switch
entity_id: switch.zw175_smart_switch_7_switch
type: turn_off
I am very new to HA, so a question here: is it possible to do if/else type of condition in Automation, so I could have one Automation to achieve the above instead of two?
Another problem I have is for some reason my device is generating not one, but two events (1s apart) when I press the button, so my light if switching ON and than back OFF after 1 sec:
2020-06-02 12:41:56 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/node/27/instance/1/commandclass/91/value/562950412091412/: b'{\n "Label": "Scene 2",\n "Value": {\n "List": [\n {\n "Value": 0,\n "Label": "Inactive"\n },\n {\n "Value": 1,\n "Label": "Pressed 1 Time"\n },\n {\n "Value": 2,\n "Label": "Key Released"\n },\n {\n "Value": 3,\n "Label": "Key Held down"\n }\n ],\n "Selected": "Pressed 1 Time",\n "Selected_id": 1\n },\n "Units": "",\n "ValueSet": false,\n "ValuePolled": false,\n "ChangeVerified": false,\n "Min": 0,\n "Max": 0,\n "Type": "List",\n "Instance": 1,\n "CommandClass": "COMMAND_CLASS_CENTRAL_SCENE",\n "Index": 2,\n "Node": 27,\n "Genre": "User",\n "Help": "",\n "ValueIDKey": 562950412091412,\n "ReadOnly": false,\n "WriteOnly": false,\n "Event": "valueChanged",\n "TimeStamp": 1591098116\n}'
2020-06-02 12:41:56 INFO (MainThread) [homeassistant.components.automation] Executing Office Light OFF
2020-06-02 12:41:56 INFO (MainThread) [homeassistant.components.automation] Office Light OFF: Running script
2020-06-02 12:41:56 INFO (MainThread) [homeassistant.components.automation] Office Light OFF: Executing step device automation
2020-06-02 12:41:56 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on OpenZWave/1/command/setvalue/: {"ValueIDKey": 441008144, "Value": false}
2020-06-02 12:41:56 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/command/setvalue/: b'{"ValueIDKey": 441008144, "Value": false}'
2020-06-02 12:41:56 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/event/setvalue/: b'{\n "status": "ok",\n "TimeStamp": 1591098116\n}'
2020-06-02 12:41:57 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/node/26/instance/1/commandclass/37/value/441008144/: b'{\n "Label": "Switch",\n "Value": false,\n "Units": "",\n "ValueSet": false,\n "ValuePolled": false,\n "ChangeVerified": false,\n "Min": 0,\n "Max": 0,\n "Type": "Bool",\n "Instance": 1,\n "CommandClass": "COMMAND_CLASS_SWITCH_BINARY",\n "Index": 0,\n "Node": 26,\n "Genre": "User",\n "Help": "Turn On/Off Device",\n "ValueIDKey": 441008144,\n "ReadOnly": false,\n "WriteOnly": false,\n "Event": "valueChanged",\n "TimeStamp": 1591098117\n}'
2020-06-02 12:41:57 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/node/27/instance/1/commandclass/91/value/562950412091412/: b'{\n "Label": "Scene 2",\n "Value": {\n "List": [\n {\n "Value": 0,\n "Label": "Inactive"\n },\n {\n "Value": 1,\n "Label": "Pressed 1 Time"\n },\n {\n "Value": 2,\n "Label": "Key Released"\n },\n {\n "Value": 3,\n "Label": "Key Held down"\n }\n ],\n "Selected": "Inactive",\n "Selected_id": 0\n },\n "Units": "",\n "ValueSet": false,\n "ValuePolled": false,\n "ChangeVerified": false,\n "Min": 0,\n "Max": 0,\n "Type": "List",\n "Instance": 1,\n "CommandClass": "COMMAND_CLASS_CENTRAL_SCENE",\n "Index": 2,\n "Node": 27,\n "Genre": "User",\n "Help": "",\n "ValueIDKey": 562950412091412,\n "ReadOnly": false,\n "WriteOnly": false,\n "Event": "valueChanged",\n "TimeStamp": 1591098117\n}'
2020-06-02 12:41:57 INFO (MainThread) [homeassistant.components.automation] Executing Office Light ON
2020-06-02 12:41:57 INFO (MainThread) [homeassistant.components.automation] Office Light ON: Running script
2020-06-02 12:41:57 INFO (MainThread) [homeassistant.components.automation] Office Light ON: Executing step device automation
2020-06-02 12:41:57 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on OpenZWave/1/command/setvalue/: {"ValueIDKey": 441008144, "Value": true}
2020-06-02 12:41:57 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/command/setvalue/: b'{"ValueIDKey": 441008144, "Value": true}'
2020-06-02 12:41:57 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/event/setvalue/: b'{\n "status": "ok",\n "TimeStamp": 1591098117\n}'
2020-06-02 12:41:58 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on OpenZWave/1/node/26/instance/1/commandclass/37/value/441008144/: b'{\n "Label": "Switch",\n "Value": true,\n "Units": "",\n "ValueSet": false,\n "ValuePolled": false,\n "ChangeVerified": false,\n "Min": 0,\n "Max": 0,\n "Type": "Bool",\n "Instance": 1,\n "CommandClass": "COMMAND_CLASS_SWITCH_BINARY",\n "Index": 0,\n "Node": 26,\n "Genre": "User",\n "Help": "Turn On/Off Device",\n "ValueIDKey": 441008144,\n "ReadOnly": false,\n "WriteOnly": false,\n "Event": "valueChanged",\n "TimeStamp": 1591098118\n}'
Fix for that will be in qt-openzwave settings I guess.
Best regards,
Chris