domoticafacilconjota / capitulos

Copy y paste del canal
38 stars 50 forks source link

Ver en profundidad las comaparaciones #7

Open Tanjaui opened 3 years ago

Tanjaui commented 3 years ago

Me gustaría sugerir que hagas un vídeo con el siguiente contenido: Describir los operandos que admiten los nodos con condiciones (Json - Entiry - PrevEntity - regular expression) En definitiva como hacer en Node-red el siguiente automatismo en formato yaml

Tanjaui commented 3 years ago

Este es el export que he hecho siguiendo tus indicaciones (añadiendo dos nodos para detectar el cambio de estado de ambas entidades): [{"id":"d2c32e51.19c1d","type":"tab","label":"Jota","disabled":false,"info":""},{"id":"df6517ab.4495a8","type":"api-render-template","z":"d2c32e51.19c1d","name":"Comparar temperaturas","server":"7b2744fd.75d62c","template":"{{ states.sensor.dormitorio_temperatura.state < states.input_number.temperatura.state }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":500,"y":320,"wires":[["42cb83ec.c3261c"]]},{"id":"8118c280.96406","type":"debug","z":"d2c32e51.19c1d","name":"Encendido","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":220,"wires":[]},{"id":"a6a5dfbf.aa0d1","type":"inject","z":"d2c32e51.19c1d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":320,"wires":[["df6517ab.4495a8"]]},{"id":"4ea4ae38.3d5ec","type":"server-state-changed","z":"d2c32e51.19c1d","name":"","server":"7b2744fd.75d62c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temperatura","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":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":180,"y":240,"wires":[["df6517ab.4495a8"]]},{"id":"f84042f9.3a0b9","type":"server-state-changed","z":"d2c32e51.19c1d","name":"","server":"7b2744fd.75d62c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.dormitorio_temperatura","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":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":190,"y":440,"wires":[["df6517ab.4495a8"]]},{"id":"42cb83ec.c3261c","type":"switch","z":"d2c32e51.19c1d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"True","vt":"str"},{"t":"eq","v":"False","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":320,"wires":[["71006687.cb5fd8"],["9723fb3c.123c98"]]},{"id":"10d1c583.0ea73a","type":"debug","z":"d2c32e51.19c1d","name":"Apagado","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":440,"wires":[]},{"id":"71006687.cb5fd8","type":"api-call-service","z":"d2c32e51.19c1d","name":"","server":"7b2744fd.75d62c","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff5_sonoff5","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":850,"y":260,"wires":[["8118c280.96406"]]},{"id":"9723fb3c.123c98","type":"api-call-service","z":"d2c32e51.19c1d","name":"","server":"7b2744fd.75d62c","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff5_sonoff5","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":850,"y":380,"wires":[["10d1c583.0ea73a"]]},{"id":"7b2744fd.75d62c","type":"server","z":"","name":"Home Assistant","addon":true}]