Zwave dimming using home assistant

#1

hello
zwave dimmer
strugling with payload msg i would like to inset a slider to the flow also
{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","brightness":"250"}
{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","brightness":"0"}
i am unable to inset this into msg payload

[{"id":"4ab4be6e.346a1","type":"api-call-service","z":"4acb2d.f25804d4","name":"level 2 off","server":"d0be6c93.2903a","service_domain":"light","service":"turn_off","data":"{ \"entity_id\": \"light.fibaro_system_fgd212_dimmer_2_level_2\" }","mergecontext":"","x":620,"y":240,"wires":[[]]},{"id":"919003f1.019d3","type":"inject","z":"4acb2d.f25804d4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":240,"wires":[["4ab4be6e.346a1"]]},{"id":"7711c01c.54644","type":"inject","z":"4acb2d.f25804d4","name":"","topic":"{\"entity_id\":\"light.fibaro_system_fgd212_dimmer_2_level_2\"}","payload":"{\"brightness\":\"250\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":160,"wires":[["9fef854f.575678","e0fbda5c.4a59b8"]]},{"id":"9fef854f.575678","type":"api-call-service","z":"4acb2d.f25804d4","name":"level 2 on","server":"d0be6c93.2903a","service_domain":"homeassistant","service":"turn_on","data":"{\"entity_id\":\"light.fibaro_system_fgd212_dimmer_2_level_2\"}","mergecontext":"","x":620,"y":160,"wires":[["e0fbda5c.4a59b8"]]},{"id":"e0fbda5c.4a59b8","type":"debug","z":"4acb2d.f25804d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":140,"wires":[]},{"id":"d0be6c93.2903a","type":"server","z":"","name":"Home Assistant","url":"http://hassio/homeassistant","pass":"012e0669445b410db7105b6a69ac73be"}]

`
msg.payload : Object

object

domain: "homeassistant"

service: "turn_on"

data: object

entity_id: "light.fibaro_system_fgd212_dimmer_2_level_2"
`

`
{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2"} : msg.payload : Object

object

brightness: "250"
`

0 Likes

#2

@chris1988, I imported your flow, but I wasn't able to figure out what the final results should be, are you trying to make a slider to control the dimming of the light or are you just trying to inject the dimmer level?

0 Likes

#3

Hello i have figured out how to do it including a switch my next problem is to get a reply message, as the brightness level so the ui knows what state it is in (new state "brightness":106), this is what i need as a payload message just the number

`
9/10/2018, 1:54:04 PMnode: 3c3a4267.30ef4estate_changed : msg.payload : string[1038]

"{"event_type":"state_changed","entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","event":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","old_state":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","state":"off","attributes":{"node_id":2,"value_index":0,"value_instance":1,"value_id":"72057594076299265","power_consumption":0,"friendly_name":"level 2","supported_features":33},"last_changed":"2018-09-10T11:03:52.663465+00:00","last_updated":"2018-09-10T11:03:52.663465+00:00","context":{"id":"6491e535c48647f4a00ecddb4b89a8e2","user_id":null}},"new_state":{"entity_id":"light.fibaro_system_fgd212_dimmer_2_level_2","state":"on","attributes":{"brightness":106,"node_id":2,"value_index":0,"value_instance":1,"value_id":"72057594076299265","power_consumption":0,"friendly_name":"level 2","supported_features":33},"last_changed":"2018-09-10T12:54:06.786045+00:00","last_updated":"2018-09-10T12:54:06.786045+00:00","context":{"id":"a0ccd2da567943ff8e129df926dea333","user_id":..."
`

Working config
[{"id":"4e425d8a.17ce24","type":"api-call-service","z":"4acb2d.f25804d4","name":"(sw 1) level 2 off","server":"d0be6c93.2903a","service_domain":"light","service":"turn_off","data":"{ \"entity_id\": \"light.fibaro_system_fgd212_dimmer_2_level_1\" }","mergecontext":"","x":860,"y":240,"wires":[["fed8677e.4a7558"]]},{"id":"4123cf39.beba9","type":"api-call-service","z":"4acb2d.f25804d4","name":"(sw 1) level 2","server":"d0be6c93.2903a","service_domain":"homeassistant","service":"turn_on","data":"{\"entity_id\":\"light.fibaro_system_fgd212_dimmer_2_level_1\"}","mergecontext":"","x":870,"y":160,"wires":[["8a312c93.c4972"]],"inputLabels":["1"],"outputLabels":["1"]},{"id":"8a312c93.c4972","type":"debug","z":"4acb2d.f25804d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1070,"y":160,"wires":[]},{"id":"fed8677e.4a7558","type":"debug","z":"4acb2d.f25804d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1050,"y":240,"wires":[]},{"id":"edb095b9.a989e8","type":"inject","z":"4acb2d.f25804d4","name":"working payload brighness","topic":"brightness","payload":"{\"data\":{\"brightness\":\"255\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":630,"y":100,"wires":[["4123cf39.beba9"]]},{"id":"5473984b.434678","type":"ui_slider","z":"4acb2d.f25804d4","name":"(sw1) level 2 dimmer","label":"Dimmer (switch 1)","group":"f4205516.c84848","order":2,"width":0,"height":0,"passthru":true,"topic":"{ \"data\": { \"brightness\": \"255\" }","min":0,"max":"255","step":1,"x":460,"y":160,"wires":[["c121033d.1758f","25d367ab.07b0b8"]],"icon":"node-red/light.png"},{"id":"c121033d.1758f","type":"template","z":"4acb2d.f25804d4","name":"","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"data\": {\n \"brightness\": \"{{payload}}\"\n }\n}\n","output":"str","x":660,"y":160,"wires":[["4123cf39.beba9"]]},{"id":"8afbecd5.c7a66","type":"ui_ui_control","z":"4acb2d.f25804d4","name":"","x":320,"y":240,"wires":[["98b460c8.6f843"]]},{"id":"854d817c.2c214","type":"inject","z":"4acb2d.f25804d4","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":160,"wires":[["5473984b.434678"]]},{"id":"98b460c8.6f843","type":"ui_switch","z":"4acb2d.f25804d4","name":"","label":"Switch 1","group":"f4205516.c84848","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":500,"y":240,"wires":[["93eb8a3c.40c928"]]},{"id":"93eb8a3c.40c928","type":"switch","z":"4acb2d.f25804d4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"on","vt":"str"},{"t":"cont","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":240,"wires":[["4123cf39.beba9"],["4e425d8a.17ce24"]]},{"id":"25d367ab.07b0b8","type":"ui_numeric","z":"4acb2d.f25804d4","name":"","label":"Level","group":"1cda2d04.aea7d3","order":2,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":0,"max":"255","step":1,"x":450,"y":200,"wires":[["5473984b.434678"]]},{"id":"d0be6c93.2903a","type":"server","z":"","name":"Home Assistant","url":"http://hassio/homeassistant","pass":"5d002058e351cab7f750e9c436162f7d367164d012481e49d1b99d16248038a7"},{"id":"f4205516.c84848","type":"ui_group","z":"4acb2d.f25804d4","name":"Switch 1 Dimmer 1","tab":"c1d76844.0bca08","order":1,"disp":true,"width":"5","collapse":true},{"id":"1cda2d04.aea7d3","type":"ui_group","z":"","name":"Lighting Levels","tab":"c1d76844.0bca08","order":3,"disp":true,"width":"6","collapse":false},{"id":"c1d76844.0bca08","type":"ui_tab","z":"4acb2d.f25804d4","name":"Home","icon":"dashboard","order":1}]

thank you for your reply

0 Likes

#4

just an update i managed ti figure it out

0 Likes