example 1
[{"id":"9c40722b5632bc5e","type":"server-state-changed","z":"4ae481611ef14d5e","name":"","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_sensor_escritorio","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"$entities(\"input_number.sensor_do_escritorio\").state","forType":"jsonata","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":268,"y":256,"wires":[["95fdc476820d8593"],[]]},{"id":"7b3ee86ed72260d1","type":"api-call-service","z":"4ae481611ef14d5e","name":"","server":"","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["group.escritorio_luzes"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1052,"y":256,"wires":[[]]},{"id":"95fdc476820d8593","type":"api-current-state","z":"4ae481611ef14d5e","name":"","server":"","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.ativar_sensor_do_escriorio","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":706,"y":256,"wires":[["7b3ee86ed72260d1"],[]]}]
example 2
[{"id":"591d93a6a9049176","type":"server-state-changed","z":"4ae481611ef14d5e","name":"","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_sensor_escritorio","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"$entity().state = off and $entities(\"input_boolean.ativar_sensor_do_escriorio\").state = on","halt_if_type":"jsonata","halt_if_compare":"jsonata","outputs":2,"output_only_on_state_change":true,"for":"$entities(\"input_number.sensor_do_escritorio\").state","forType":"jsonata","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":280,"y":384,"wires":[["45ef65ef6bae3ed6"],[]]},{"id":"45ef65ef6bae3ed6","type":"api-call-service","z":"4ae481611ef14d5e","name":"","server":"","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":[],"entityId":["group.escritorio_luzes"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":384,"wires":[[]]}]
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/jsonata.html