Hello all!
I’ve decided to ditch the YAML code and go for the Node-Red way!
A lot of things work, but there is this one automation I can’t make work properly in Node-Red.
It works in perfectly in YAML. So when it’s 8:32 and none of our phones are charging, the shutters (Rolluiken ) can go up. If one phone is charging, they can’t go up.
- alias: rolluiken boven omhoog ochtend
description: ""
trigger:
- platform: time
at: 08:32:01
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.motorola_one_action_is_aan_het_opladen
state: "off"
- condition: state
entity_id: binary_sensor.sm_a405fn_is_aan_het_opladen
state: "off"
action:
- service: nodered.trigger
data:
entity_id: switch.boven_alles_op
This is the flow in Node-Red:
[{"id":"646820f5.f1109","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ca8e5f0f.91ff6","type":"api-call-service","z":"646820f5.f1109","name":"Boven omhoog","server":"561508bb.cf72f8","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"switch.boven_alles_op","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":740,"y":160,"wires":[[]]},{"id":"95e80375.8e44e","type":"and-gate","z":"646820f5.f1109","name":"","rules":[{"t":"eq","v":"off","vt":"str","propertyType":"msg","property":"payload","topic":"binary_sensor.motorola_one_action_is_aan_het_opladen"},{"t":"eq","v":"off","vt":"str","propertyType":"msg","property":"payload","topic":"binary_sensor.sm_a405fn_is_aan_het_opladen"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":260,"y":180,"wires":[["cdf2d907.c95038"]]},{"id":"e8933209.f2c62","type":"server-state-changed","z":"646820f5.f1109","name":"gsm stef","server":"561508bb.cf72f8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motorola_one_action_is_aan_het_opladen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":100,"y":140,"wires":[["95e80375.8e44e"]]},{"id":"a6aa6db7.fc1a2","type":"server-state-changed","z":"646820f5.f1109","name":"gsm bieke","server":"561508bb.cf72f8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.sm_a405fn_is_aan_het_opladen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":100,"y":220,"wires":[["95e80375.8e44e"]]},{"id":"cdf2d907.c95038","type":"time-range-switch","z":"646820f5.f1109","name":"","lat":"50.90289","lon":"2.92136","startTime":"08:30","endTime":"08:31","startOffset":0,"endOffset":0,"x":470,"y":180,"wires":[["ca8e5f0f.91ff6"],[]]},{"id":"561508bb.cf72f8","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
It only triggers when we disconnect the phone in the specfic time range… But it has to do this as well when none of our phones are charging.
Any tips or tricks or help?