Is this or is this not valid JSONata?

$number($globalContext('homeassistant.homeAssistant.states["input_number.bathroom_minimum_turn_on"].state'))

I am using a switch node and want to compare the values of these two entities but I have spent all day on it to no avail...

[{"id":"ebea607c.60b9","type":"api-call-service","z":"a12b6ffa.5393c","name":"Turn OFF","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bathroom_light","data":"{\"transition\":2}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":483,"y":220,"wires":[[]]},{"id":"b070924f.3df56","type":"api-call-service","z":"a12b6ffa.5393c","name":"Initial","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_light","data":"{\t   \"brightness\": $number($globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state'))\t}\t","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":830,"y":163,"wires":[["8373073011267736"]]},{"id":"c8ab09be.516638","type":"delay","z":"a12b6ffa.5393c","name":"1/2s","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":950,"y":112,"wires":[["b69440ca.76c46"]]},{"id":"bc0fda2c.ebe9f8","type":"server-state-changed","z":"a12b6ffa.5393c","name":"Bathroom motion","server":"c879ac61.99cd1","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.bathroom_motion","entityidfiltertype":"exact","outputinitially":true,"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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":105,"y":160,"wires":[["c92b962.4f5ac68"]]},{"id":"58d0dff9.21c4d","type":"ui_switch","z":"a12b6ffa.5393c","name":"","label":"Bathroom Motion","tooltip":"","group":"f295ef41.2abab","order":12,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"binary_sensor.bathroom_motion","topicType":"str","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","animate":false,"x":95,"y":221,"wires":[["c92b962.4f5ac68"]]},{"id":"5ee3e8f3.9c6d18","type":"api-current-state","z":"a12b6ffa.5393c","name":"sleep mode","server":"c879ac61.99cd1","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.sleep_mode","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":496,"y":155,"wires":[["669d063b0933aee2"],["c398413f.ac67a"]]},{"id":"c398413f.ac67a","type":"switch","z":"a12b6ffa.5393c","name":"<minimum?","property":"payload","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"$number($globalContext('nr_circadian_brightness')) < $number($globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state'))\t","vt":"jsonata"},{"t":"jsonata_exp","v":"$number($globalContext('nr_circadian_brightness')) >= $number($globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state'))\t","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":665,"y":193,"wires":[["b070924f.3df56","6d62a292c9b1c6ac"],["7c0d078b.390718"],["6d62a292c9b1c6ac"]]},{"id":"7c0d078b.390718","type":"api-call-service","z":"a12b6ffa.5393c","name":"Turn ON","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_light","data":"{\"brightness\":\"{{global.nr_circadian_brightness}}\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":214,"wires":[[]]},{"id":"b69440ca.76c46","type":"api-call-service","z":"a12b6ffa.5393c","name":"Minimum","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_light","data":"{\t   \"brightness\": 5\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1080,"y":112,"wires":[[]]},{"id":"c92b962.4f5ac68","type":"multiSensor","z":"a12b6ffa.5393c","name":"","idType":"msg","idField":"topic","inputType":"msg","inputValue":"payload","activeType":"str","activeValue":"on","inactiveType":"str","inactiveValue":"off","activateDelay":"0","activateDelayUnit":"seconds","inactivateDelay":"30","inactivateDelayUnit":"seconds","sendOnActiveType":"pay","sendOnActive":"","sendOnInactiveType":"payl","sendOnInactive":"","sendOnTimeoutType":"pay","sendOnTimeout":"","aTimeout":"0","aTimeoutUnit":"minutes","sTimeout":"0","sTimeoutUnit":"minutes","seperated":true,"useCount":false,"outputs":3,"x":309,"y":189,"wires":[["5ee3e8f3.9c6d18"],["ebea607c.60b9"],[]]},{"id":"8373073011267736","type":"delay","z":"a12b6ffa.5393c","name":"1/2s","pauseType":"delay","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":951,"y":163,"wires":[["ceaffdac7e752eae"]]},{"id":"ceaffdac7e752eae","type":"api-call-service","z":"a12b6ffa.5393c","name":"Adjust","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_light","data":"{\t   \"brightness\": $max(\t       [\t           5,\t           $globalContext('nr_circadian_brightness')\t       ]\t   )\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1071,"y":163,"wires":[[]]},{"id":"669d063b0933aee2","type":"api-call-service","z":"a12b6ffa.5393c","name":"Initial","server":"c879ac61.99cd1","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bathroom_light","data":"{\t   \"brightness\": $globalContext('input_number.bathroom_minimum_turn_on')\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":650,"y":112,"wires":[["c8ab09be.516638"]]},{"id":"6d62a292c9b1c6ac","type":"debug","z":"a12b6ffa.5393c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":320,"wires":[]},{"id":"c879ac61.99cd1","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"f295ef41.2abab","type":"ui_group","name":"Bathroom","tab":"f1b3c4b9490cc675","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f1b3c4b9490cc675","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

How should this be coded?
Thanks!

This seems like a testament how home assistant non elegantly complicates things.
The evaluation test should be the brightness I think ?

if value > output 1
if value < output 2

something like:

Thanks but no luck with that either...

[{"id":"c398413f.ac67a","type":"switch","z":"a12b6ffa.5393c","name":"<minimum?","property":"$number($globalContext('nr.circadian_brightness'))","propertyType":"jsonata","rules":[{"t":"lt","v":"$number($globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state'))","vt":"jsonata"},{"t":"gte","v":"$number($globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state'))","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":665,"y":193,"wires":[["b070924f.3df56","c1c3436d071a208d"],["7c0d078b.390718","1109b986f29cc896"],["6d62a292c9b1c6ac"]]}]

Does the input_number.bathroom_minimum_turn_on.state actually produce a number ? or is it "off/on" ?

Show us the (copy/pastable) debug outputs of the values you are working with.

It is producing a string hence why I am surrounding it with $number()...


homeAssistant.states["input_number.bathroom_minimum_turn_on"].state
state "15.0"
image

image

2/1/2022, 12:49:26 AMnode: 2a27dcbc66d5a3a4
input_number.bathroom_minimum_turn_on : msg : Object
object
payload: "15.0"
data: object
entity_id: "input_number.bathroom_minimum_turn_on"
old_state: object
entity_id: "input_number.bathroom_minimum_turn_on"
state: "15.0"
attributes: object
last_changed: "2022-02-01T00:40:52.260705+00:00"
last_updated: "2022-02-01T00:40:52.260705+00:00"
context: object
original_state: "15.0"
timeSinceChangedMs: 29312069
new_state: object
entity_id: "input_number.bathroom_minimum_turn_on"
state: "15.0"
attributes: object
last_changed: "2022-02-01T00:40:52.260705+00:00"
last_updated: "2022-02-01T00:40:52.260705+00:00"
context: object
original_state: "15.0"
timeSinceChangedMs: 29312069
topic: "input_number.bathroom_minimum_turn_on"
_msgid: "5c71f881d092bfbe"

and what does the sleep mode node produce for the input of the switch node ?

image

2/1/2022, 12:58:38 AMnode: 2a27dcbc66d5a3a4
binary_sensor.bathroom_motion : msg : Object
object
payload: "off"
topic: "binary_sensor.bathroom_motion"
socketid: "11qFGIlOKtvR_NyPAAAB"
_msgid: "c959fa385bf448ee"
data: object
entity_id: "input_boolean.sleep_mode"
state: "off"
attributes: object
last_changed: "2022-02-01T00:40:53.677169+00:00"
last_updated: "2022-02-01T00:40:53.677169+00:00"
context: object
timeSinceChangedMs: 29864669
original_state: "off"

The problem is the . in the name.

When Node-RED evaluates the statement - homeAssistant.states["input_number.bathroom_minimum_turn_on"] it parses the property name as if it were a JavaScript identifier.

This means it first looks for an object called input_number and then looks up a property of that object called bathroom_minimum_turn_on.

That will not work when the object name has a . in it.

Oh wow! Really?? What's the solution (if any)?

I think you need to move the input_number.bathroom_minimum_turn_on lookup out of the call to globalContext

$number($globalContext('homeassistant.homeAssistant.states')["input_number.bathroom_minimum_turn_on"].state)

That syntax fails as do:

$number($globalContext('homeassistant.homeAssistant.states["input_number.bathroom_minimum_turn_on"].state'))
$number($globalContext('homeassistant.homeAssistant.states["input_number.bathroom_minimum_turn_on"]'.state))

What is the value of $globalContext('homeassistant.homeAssistant.states') ?

Use the copy value function found in the context tab

Screenshot 2022-02-01 at 10.49.06

image

Truncated...

,"zone.select_express":{"entity_id":"zone.select_express","state":"zoning","attributes":{"latitude":49.23289236942634,"longitude":-122.82306556407177,"radius":30.48013447922684,"passive":false,"editable":true,"icon":"mdi:map-marker","friendly_name":"Select Express"},"last_changed":"2022-02-01T00:40:52.255456+00:00","last_updated":"2022-02-01T00:40:52.255456+00:00","context":{"id":"010c741ed320bcfe1c090759615b6380","parent_id":null,"user_id":null}},"input_number.outside_lux_trigger_point":{"entity_id":"input_number.outside_lux_trigger_point","state":"20.0","attributes":{"initial":null,"editable":true,"min":0,"max":200,"step":1,"mode":"box","unit_of_measurement":" lx","friendly_name":"Outside Lux Trigger Point"},"last_changed":"2022-02-01T00:40:52.256524+00:00","last_updated":"2022-02-01T00:40:52.256524+00:00","context":{"id":"59a3c19fe6d6c86c292a9b604e4cac70","parent_id":null,"user_id":null}},"input_number.bedroom_lux_trigger_point":{"entity_id":"input_number.bedroom_lux_trigger_point","state":"80.0","attributes":{"initial":null,"editable":true,"min":0,"max":300,"step":1,"mode":"box","unit_of_measurement":" lx","friendly_name":"Bedroom Lux Trigger Point"},"last_changed":"2022-02-01T00:40:52.256716+00:00","last_updated":"2022-02-01T00:40:52.256716+00:00","context":{"id":"66c73a4d447079df59f0ef54ea6a52c9","parent_id":null,"user_id":null}},"input_number.cactus_light_duration":{"entity_id":"input_number.cactus_light_duration","state":"30.0","attributes":{"initial":null,"editable":true,"min":0,"max":300,"step":5,"mode":"slider","unit_of_measurement":"minutes","icon":"hass:cactus","friendly_name":"Cactus Light Duration"},"last_changed":"2022-02-01T00:40:52.256885+00:00","last_updated":"2022-02-01T00:40:52.256885+00:00","context":{"id":"e83a5521b19aeea02f35f97ffe4b315b","parent_id":null,"user_id":null}},"input_number.hvac_last_heat_temp_change":{"entity_id":"input_number.hvac_last_heat_temp_change","state":"1.0","attributes":{"initial":null,"editable":true,"min":0,"max":30,"step":0.01,"mode":"box","unit_of_measurement":"°C","icon":"hass:thermometer-chevron-up","friendly_name":"HVAC Last Heat Temp Change"},"last_changed":"2022-02-01T00:40:52.257052+00:00","last_updated":"2022-02-01T00:40:52.257052+00:00","context":{"id":"f8ea8755b25f8300655e02274a11f9e6","parent_id":null,"user_id":null}},"input_number.hvac_heat_start_temp":{"entity_id":"input_number.hvac_heat_start_temp","state":"21.1","attributes":{"initial":null,"editable":true,"min":5,"max":30,"step":0.01,"mode":"box","unit_of_measurement":"°C","icon":"hass:thermometer-low","friendly_name":"HVAC Heat Start Temp"},"last_changed":"2022-02-01T07:50:12.334146+00:00","last_updated":"2022-02-01T07:50:12.334146+00:00","context":{"id":"bdaa94f3610e0bc52ecf34205794b04e","parent_id":"2d99f5db782f42f1541fce0eb285503f","user_id":null}},"input_number.hvac_heat_end_temp":{"entity_id":"input_number.hvac_heat_end_temp","state":"20.8","attributes":{"initial":null,"editable":true,"min":5,"max":30,"step":0.1,"mode":"box","unit_of_measurement":"°C","icon":"hass:thermometer-high","friendly_name":"HVAC Heat End Temp"},"last_changed":"2022-02-01T07:50:08.022362+00:00","last_updated":"2022-02-01T07:50:08.022362+00:00","context":{"id":"ab91e03d9c19a9eb84e742d4db3af8cf","parent_id":"f1cb4e80bf43dfdf7acc20e9655a6f79","user_id":null}},"input_number.hvac_last_time_to_temp":{"entity_id":"input_number.hvac_last_time_to_temp","state":"1200.0","attributes":{"initial":null,"editable":true,"min":0,"max":86400,"step":0.001,"mode":"box","unit_of_measurement":"elapsed seconds","icon":"hass:timer-outline","friendly_name":"HVAC Last Time to Temp"},"last_changed":"2022-02-01T00:40:52.257538+00:00","last_updated":"2022-02-01T00:40:52.257538+00:00","context":{"id":"44acca039079052a7eaf72dd40bcdaed","parent_id":null,"user_id":null}},"input_number.coffee_filter_count":{"entity_id":"input_number.coffee_filter_count","state":"185.0","attributes":{"initial":null,"editable":true,"min":0,"max":300,"step":1,"mode":"box","unit_of_measurement":"Filters left","friendly_name":"Filter Count"},"last_changed":"2022-02-01T00:40:52.257693+00:00","last_updated":"2022-02-01T00:40:52.257693+00:00","context":{"id":"ebd35a7f7fee003680da9ad0e1b9f33e","parent_id":null,"user_id":null}},"input_number.hvac_current_heat_start_temp":{"entity_id":"input_number.hvac_current_heat_start_temp","state":"21.1","attributes":{"initial":null,"editable":true,"min":0,"max":100,"step":1,"mode":"box","unit_of_measurement":"°C","icon":"hass:thermometer-low","friendly_name":"HVAC Current Heat Start Temp"},"last_changed":"2022-02-01T07:41:10.171561+00:00","last_updated":"2022-02-01T07:41:10.171561+00:00","context":{"id":"5f9f0101635d1de2e36b671f9e5df438","parent_id":"1e5c3363b6b79cb7fbc2da4541868786","user_id":null}},"input_number.pc_active_timeout":{"entity_id":"input_number.pc_active_timeout","state":"300.0","attributes":{"initial":null,"editable":true,"min":0,"max":300,"step":1,"mode":"box","unit_of_measurement":"seconds","friendly_name":"PC Active Timeout"},"last_changed":"2022-02-01T00:40:52.258009+00:00","last_updated":"2022-02-01T00:40:52.258009+00:00","context":{"id":"dec1eb210a2242af9e26a8b5211c6c61","parent_id":null,"user_id":null}},"input_number.kitchen_blind_1":{"entity_id":"input_number.kitchen_blind_1","state":"48.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Kitchen Blind 1"},"last_changed":"2022-02-01T00:40:52.258165+00:00","last_updated":"2022-02-01T00:40:52.258165+00:00","context":{"id":"25f6011c7c63e4782e4f7d960838f23e","parent_id":null,"user_id":null}},"input_number.kitchen_blind_2":{"entity_id":"input_number.kitchen_blind_2","state":"49.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Kitchen Blind 2"},"last_changed":"2022-02-01T00:40:52.258314+00:00","last_updated":"2022-02-01T00:40:52.258314+00:00","context":{"id":"97e94d3593395c1fc24f0961dfe442d7","parent_id":null,"user_id":null}},"input_number.kitchen_blind_3":{"entity_id":"input_number.kitchen_blind_3","state":"55.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Kitchen Blind 3"},"last_changed":"2022-02-01T00:40:52.258464+00:00","last_updated":"2022-02-01T00:40:52.258464+00:00","context":{"id":"57d612e58befd787cccb5eb4c964b48a","parent_id":null,"user_id":null}},"input_number.living_room_blind":{"entity_id":"input_number.living_room_blind","state":"40.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Living Room Blind"},"last_changed":"2022-02-01T00:40:52.258622+00:00","last_updated":"2022-02-01T00:40:52.258622+00:00","context":{"id":"a370272bd3816e0bac10d8706832cd6e","parent_id":null,"user_id":null}},"input_number.patio_door_blind":{"entity_id":"input_number.patio_door_blind","state":"40.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Patio Door Blind"},"last_changed":"2022-02-01T00:40:52.258777+00:00","last_updated":"2022-02-01T00:40:52.258777+00:00","context":{"id":"55c1ad6886e0ce3880e2df20ec7d762a","parent_id":null,"user_id":null}},"input_number.bedroom_blind":{"entity_id":"input_number.bedroom_blind","state":"45.0","attributes":{"initial":null,"editable":true,"min":0,"max":99,"step":1,"mode":"box","friendly_name":"Bedroom Blind"},"last_changed":"2022-02-01T00:40:52.258943+00:00","last_updated":"2022-02-01T00:40:52.258943+00:00","context":{"id":"3c466ab3c11ef6e9802d2688ba9d52da","parent_id":null,"user_id":null}},"input_number.living_room_lux_trigger_point":{"entity_id":"input_number.living_room_lux_trigger_point","state":"175.0","attributes":{"initial":null,"editable":true,"min":100,"max":1000,"step":25,"mode":"slider","unit_of_measurement":"lx","friendly_name":"Living Room Lux Trigger Point"},"last_changed":"2022-02-01T00:40:52.259093+00:00","last_updated":"2022-02-01T00:40:52.259093+00:00","context":{"id":"aed0a21396fa8e444bf76ecfc5944082","parent_id":null,"user_id":null}},"input_number.fireplace_light_auto_off_time":{"entity_id":"input_number.fireplace_light_auto_off_time","state":"2.0","attributes":{"initial":null,"editable":true,"min":0,"max":15,"step":1,"mode":"slider","unit_of_measurement":"min","friendly_name":"Fireplace Light Auto Off Time"},"last_changed":"2022-02-01T00:40:52.259245+00:00","last_updated":"2022-02-01T00:40:52.259245+00:00","context":{"id":"e7795a9dc8ff190963cb97ea79f651b6","parent_id":null,"user_id":null}},"input_number.bchydro_step_1_rate":{"entity_id":"input_number.bchydro_step_1_rate","state":"0.0939","attributes":{"initial":null,"editable":true,"min":0,"max":1,"step":1,"mode":"box","unit_of_measurement":"CAD/kWh","icon":"mdi:alpha-h-circle-outline","friendly_name":"BCHydro Step 1 Rate"},"last_changed":"2022-02-01T00:40:52.259400+00:00","last_updated":"2022-02-01T00:40:52.259400+00:00","context":{"id":"d9aa0fa9d0d3b313ab1702910f717e41","parent_id":null,"user_id":null}},"input_number.bchydro_step_2_rate":{"entity_id":"input_number.bchydro_step_2_rate","state":"0.1408","attributes":{"initial":null,"editable":true,"min":0,"max":1,"step":1,"mode":"box","unit_of_measurement":"CAD/kWh","icon":"mdi:alpha-h-circle-outline","friendly_name":"BCHydro Step 2 Rate"},"last_changed":"2022-02-01T00:40:52.259560+00:00","last_updated":"2022-02-01T00:40:52.259560+00:00","context":{"id":"0d6a6c318059dee3e7abeb9758f49b8a","parent_id":null,"user_id":null}},"input_number.bchydro_current_rate":{"entity_id":"input_number.bchydro_current_rate","state":"0.1408","attributes":{"initial":null,"editable":true,"min":0,"max":1,"step":1,"mode":"box","unit_of_measurement":"CAD/kWh","icon":"mdi:alpha-h-circle-outline","friendly_name":"BCHydro Current Rate"},"last_changed":"2022-02-01T00:40:52.259711+00:00","last_updated":"2022-02-01T00:40:52.259711+00:00","context":{"id":"16c3eb4e71f79009bf08c77f83ea724f","parent_id":null,"user_id":null}},"input_number.kitchen_motion_activated_light_level":{"entity_id":"input_number.kitchen_motion_activated_light_level","state":"500.0","attributes":{"initial":null,"editable":true,"min":400,"max":1200,"step":25,"mode":"slider","unit_of_measurement":"lux","friendly_name":"Kitchen Motion Activated Light Level"},"last_changed":"2022-02-01T00:40:52.259865+00:00","last_updated":"2022-02-01T00:40:52.259865+00:00","context":{"id":"ef13e66b1c9dc0a41a5285ff1e5a6aad","parent_id":null,"user_id":null}},"input_number.kitchen_minimum_turn_on":{"entity_id":"input_number.kitchen_minimum_turn_on","state":"17.0","attributes":{"initial":null,"editable":true,"min":0,"max":100,"step":1,"mode":"box","friendly_name":"Kitchen Minimum Turn On"},"last_changed":"2022-02-01T00:40:52.260065+00:00","last_updated":"2022-02-01T00:40:52.260065+00:00","context":{"id":"b6f8968abb861fe585ec8cd7095ea3ad","parent_id":null,"user_id":null}},"input_number.bathroom_minimum_turn_on":{"entity_id":"input_number.bathroom_minimum_turn_on","state":"15.0","attributes":{"initial":null,"editable":true,"min":0,"max":100,"step":1,"mode":"box","friendly_name":"Bathroom Minimum Turn On"},"last_changed":"2022-02-01T00:40:52.260705+00:00","last_updated":"2022-02-01T00:40:52.260705+00:00","context":{"id":"5bfc5ebe13144f35c79697083fc4bd90","parent_id":null,"user_id":null}},"input_boolean.living_room_automatic_lights":{"entity_id":"input_boolean.living_room_automatic_lights","state":"on","attributes":{"editable":true,"icon":"hass:gesture-tap","friendly_name":"Living Room Automatic Lights"},"last_changed":"2022-02-01T00:40:53.676826+00:00","last_updated":"2022-02-01T00:40:53.676826+00:00","context":{"id":"424a56abdbba99b86753212b0ce41974","parent_id":null,"user_id":null}},"input_boolean.sleep_mode":{"entity_id":"input_boolean.sleep_mode","state":"off","attributes":{"editable":true,"icon":"hass:gesture-tap","friendly_name":"Bedroom Sleep Mode"},"last_changed":"2022-02-01T00:40:53.677169+00:00","last_updated":"2022-02-01T00:40:53.677169+00:00","context":{"id":"e8beef9292f3ab0cafa8ecaffaeb6560","parent_id":null,"user_id":null}},"input_boolean.allow_automation_execution":{"entity_id":"input_boolean.allow_automation_execution","state":"on","attributes":{"editable":true,"friendly_name":"Allow Automation Execution"},"last_changed":"2022-02-01T00:40:53.677389+00:00","last_updated":"2022-02-01T00:40:53.677389+00:00","context":{"id":"83ed3b228c1546c3c10b6f44477804f0","parent_id":null,"user_id":null}},"input_boolean.system_ready":{"entity_id":"input_boolean.system_ready","state":"on","attributes":{"editable":true,"friendly_name":"System Ready"},"last_changed":"2022-02-01T00:40:53.677569+00:00","last_updated":"2022-02-01T00:40:53.677569+00:00","context":{"id":"ac248107ada453abbdc21b3a0043764a","parent_id":null,"user_id":null}},"input_boolean.dryer":{"entity_id":"input_boolean.dryer","state":"off","attributes":{"editable":true,"icon":"mdi:toggle-switch","friendly_name":"Dryer"},"last_changed":"2022-02-01T00:40:53.677739+00:00","last_updated":"2022-02-01T00:40:53.677739+00:00","context":{"id":"48714d0d4f6d95786692c0d58a45990f","parent_id":null,"user_id":null}},"input_boolean.washer":{"entity_id":"input_boolean.washer","state":"off","attributes":{"editable":true,"icon":"mdi:toggle-switch","friendly_name":"Washer"},"last_changed":"2022-02-01T00:40:53.677908+00:00","last_updated":"2022-02-01T00:40:53.677908+00:00","context":{"id":"8f23b3ddfa11e98e959d7c1c6d0375a3","parent_id":null,"user_id":null}},"input_boolean.show_unavailable_batteries":{"entity_id":"input_boolean.show_unavailable_batteries","state":"off","attributes":{"editable":true,"icon":"hass:battery-off-outline","friendly_name":"Show Unavailable Batteries"},"last_changed":"2022-02-01T00:40:53.678071+00:00","last_updated":"2022-02-01T00:40:53.678071+00:00","context":{"id":"4916d64c4de9d869721f08046425e7de","parent_id":null,"user_id":null}},"input_boolean.away_mode":{"entity_id":"input_boolean.away_mode","state":"on","attributes":{"editable":true,"icon":"hass:leaf","friendly_name":"away_mode"},"last_changed":"2022-02-01T00:40:53.678231+00:00","last_updated":"2022-02-01T00:40:53.678231+00:00","context":{"id":"225bfca7c4e9b379b330aff9148380ec","parent_id":null,"user_id":null}},"input_boolean.coffee_prepared":{"entity_id":"input_boolean.coffee_prepared","state":"off","attributes":{"editable":true,"icon":"mdi:coffee-to-go","friendly_name":"Coffee Prepared"},"last_changed":"2022-02-01T00:40:53.678394+00:00","last_updated":"2022-02-01T00:40:53.678394+00:00","context":{"id":"137611f524cd08908ebec347e83cb37d","parent_id":null,"user_id":null}},"input_boolean.daniel_is_awake":{"entity_id":"input_boolean.daniel_is_awake","state":"on","attributes":{"editable":true,"friendly_name":"Daniel is Awake"},"last_changed":"2022-02-01T00:40:53.678583+00:00","last_updated":"2022-02-01T00:40:53.678583+00:00","context":{"id":"4f9c3d3f9ddf0acdc075f0ecbf5a4e07","parent_id":null,"user_id":null}},"input_boolean.garbage_is_out":{"entity_id":"input_boolean.garbage_is_out","state":"off","attributes":{"editable":true,"friendly_name":"Garbage is Out","templates":{"icon_color":"if (state == 'on') return 'green'; return 'red';\n"}},"last_changed":"2022-02-01T00:40:53.678786+00:00","last_updated":"2022-02-01T00:40:53.678786+00:00","context":{"id":"5d1ed86abb023cbe991debcc57e84381","parent_id":null,"user_id":null}},"input_boolean.recycling_is_out":{"entity_id":"input_boolean.recycling_is_out","state":"off","attributes":{"editable":true,"friendly_name":"Recycling is Out","templates":{"icon_color":"if (state == 'on') return 'green'; return 'red';\n"}},"last_changed":"2022-02-01T00:40:53.678956+00:00","last_updated":"2022-02-01T00:40:53.678956+00:00","context":{"id":"866c035ffd6734206c5781445ba04c69","parent_id":null,"user_id":null}},"input_boolean.bedroom_automatic_lights":{"entity_id":"input_boolean.bedroom_automatic_lights","state":"on","attributes":{"editable":true,"icon":"hass:gesture-tap","friendly_name":"Bedroom Automatic Lights"},"last_changed":"2022-02-01T00:40:53.679110+00:00","last_updated":"2022-02-01T00:40:53.679110+00:00","context":{"id":"14ec6d6b176f9a83ef1af0ed8dd48a10","parent_id":null,"user_id":null}},"input_boolean.living_room_sleep_light":{"entity_id":"input_boolean.living_room_sleep_light","state":"off","attributes":{"editable":true,"icon":"hass:gesture-tap","friendly_name":"Living Room Sleep Mode"},"last_changed":"2022-02-01T00:40:53.679264+00:00","last_updated":"2022-02-01T00:40:53.679264+00:00","context":{"id":"e795714c67d0d2dc9eb98aecd1cfc7b6","parent_id":null,"user_id":null}},"input_boolean.coffee_is_ready":{"entity_id":"input_boolean.coffee_is_ready","state":"off","attributes":{"editable":true,"icon":"hass:coffee","friendly_name":"Coffee is Ready"},"last_changed":"2022-02-01T00:40:53.679412+00:00","last_updated":"2022-02-01T00:40:53.679412+00:00","context":{"id":"ebf6cd76060351ef75e707187c7feb9d","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting":{"entity_id":"input_boolean.circadian_lighting","state":"on","attributes":{"editable":true,"friendly_name":"Global Circadian Lighting"},"last_changed":"2022-02-01T00:40:53.679561+00:00","last_updated":"2022-02-01T00:40:53.679561+00:00","context":{"id":"b4b1cc23f795cd82caca011c2c9b4fa4","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_office":{"entity_id":"input_boolean.circadian_lighting_office","state":"off","attributes":{"editable":true,"friendly_name":"Circadian Office"},"last_changed":"2022-02-01T08:52:53.620683+00:00","last_updated":"2022-02-01T08:52:53.620683+00:00","context":{"id":"ca2bc98c01dda14fd34d1a34f08d319e","parent_id":null,"user_id":"7c824b7712954da39c719cddefae9008"}},"input_boolean.circadian_lighting_sleep_mode_office":{"entity_id":"input_boolean.circadian_lighting_sleep_mode_office","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Sleep  Office"},"last_changed":"2022-02-01T00:40:53.679849+00:00","last_updated":"2022-02-01T00:40:53.679849+00:00","context":{"id":"31514ef257c49f856638265168a6a2e9","parent_id":null,"user_id":null}},"input_boolean.wakeup_enabled":{"entity_id":"input_boolean.wakeup_enabled","state":"off","attributes":{"editable":true,"icon":"hass:alarm","friendly_name":"Wake-up lights"},"last_changed":"2022-02-01T00:40:53.680076+00:00","last_updated":"2022-02-01T00:40:53.680076+00:00","context":{"id":"bd92dcfde7ecd60da1b1ec0b7d847b1f","parent_id":null,"user_id":null}},"input_boolean.wakeup_weekend":{"entity_id":"input_boolean.wakeup_weekend","state":"off","attributes":{"editable":true,"icon":"mdi:calendar","friendly_name":"Enable Wake-up on weekends"},"last_changed":"2022-02-01T00:40:53.680233+00:00","last_updated":"2022-02-01T00:40:53.680233+00:00","context":{"id":"40e7bb5bdc382fda6a01a9d372332928","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_bedroom":{"entity_id":"input_boolean.circadian_lighting_bedroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Bedroom"},"last_changed":"2022-02-01T00:40:53.680391+00:00","last_updated":"2022-02-01T00:40:53.680391+00:00","context":{"id":"dde45a96ff26b3130edcd264debbb9a7","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_brightness_bedroom":{"entity_id":"input_boolean.circadian_lighting_brightness_bedroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Bedroom Brightness "},"last_changed":"2022-02-01T00:40:53.680541+00:00","last_updated":"2022-02-01T00:40:53.680541+00:00","context":{"id":"f08e2945f757bb4416ab23898038ea75","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_color_bedroom":{"entity_id":"input_boolean.circadian_lighting_color_bedroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Bedroom Color "},"last_changed":"2022-02-01T00:40:53.680685+00:00","last_updated":"2022-02-01T00:40:53.680685+00:00","context":{"id":"287ada7ccbb47803fa6912f2d6618cbf","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_brightness_office":{"entity_id":"input_boolean.circadian_lighting_brightness_office","state":"off","attributes":{"editable":true,"friendly_name":"Circadian Office Brightness "},"last_changed":"2022-02-01T08:52:54.242561+00:00","last_updated":"2022-02-01T08:52:54.242561+00:00","context":{"id":"b87928174e4e436c15c34c7652419137","parent_id":null,"user_id":"7c824b7712954da39c719cddefae9008"}},"input_boolean.circadian_lighting_color_office":{"entity_id":"input_boolean.circadian_lighting_color_office","state":"off","attributes":{"editable":true,"friendly_name":"Circadiang Office Color "},"last_changed":"2022-02-01T08:52:55.010135+00:00","last_updated":"2022-02-01T08:52:55.010135+00:00","context":{"id":"d98e0f9b2b832720cc7c9975bbfc60fc","parent_id":null,"user_id":"7c824b7712954da39c719cddefae9008"}},"input_boolean.circadian_lighting_brightness_bathroom":{"entity_id":"input_boolean.circadian_lighting_brightness_bathroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian Bathroom Brightness"},"last_changed":"2022-02-01T00:40:53.681126+00:00","last_updated":"2022-02-01T00:40:53.681126+00:00","context":{"id":"2a9b97da0be13a8ee1a263f1299a5d6a","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_color_bathroom":{"entity_id":"input_boolean.circadian_lighting_color_bathroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian Bathroom Color "},"last_changed":"2022-02-01T00:40:53.681278+00:00","last_updated":"2022-02-01T00:40:53.681278+00:00","context":{"id":"7243b9010df74f3913409c2d4519eb60","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_bathroom":{"entity_id":"input_boolean.circadian_lighting_bathroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian Bathroom"},"last_changed":"2022-02-01T00:40:53.681431+00:00","last_updated":"2022-02-01T00:40:53.681431+00:00","context":{"id":"64ffe9f59b149339eea45502db38bf9a","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_sleep_mode_bathroom":{"entity_id":"input_boolean.circadian_lighting_sleep_mode_bathroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Sleep  Bathroom"},"last_changed":"2022-02-01T00:40:53.686929+00:00","last_updated":"2022-02-01T00:40:53.686929+00:00","context":{"id":"eb10be6ca3f89f10c69b4d4e5ccc4741","parent_id":null,"user_id":null}},"input_boolean.circadian_lighting_sleep_mode_bedroom":{"entity_id":"input_boolean.circadian_lighting_sleep_mode_bedroom","state":"on","attributes":{"editable":true,"friendly_name":"Circadian  Sleep  Bedroom"},"last_changed":"2022-02-01T00:40:53.687146+00:00","last_updated":"2022-02-01T00:40:53.687146+00:00","context":{"id":"b0943cc43d0afcc94ddfd44ef62f9945","parent_id":null,"user_id":null}},"input_boolean.reset_multisensor":{"entity_id":"input_boolean.reset_multisensor","state":"off","attributes":{"editable":true,"friendly_name":"Reset Multisensor"},"last_changed":"2022-02-01T00:40:53.687298+00:00","last_updated":"2022-02-01T00:40:53.687298+00:00","context":{"id":"4715ecaba98a61e94f67485cb634bd64","parent_id":null,"user_id":null}},"input_boolean.medication_taken":{"entity_id":"input_boolean.medication_taken","state":"off","attributes":{"editable":true,"icon":"mdi:pill","friendly_name":"Medication Taken"},"last_changed":"2022-02-01T04:00:00.274032+00:00","last_updated":"2022-02-01T04:00:00.274032+00:00","context":{"id":"2e87454642b16cfaf422b461fa815f7f","parent_id":null,"user_id":null}},"input_select.washing_machine_status":{"entity_id":"input_select.washing_machine_status","state":"Busy","attributes":{"options":["Off","Busy"],"editable":true,"icon":"mdi:washing-machine","friendly_name":"Washing Machine Status"},"last_changed":"2022-02-01T00:40:53.688756+00:00","last_updated":"2022-02-01T00:40:53.688756+00:00","context":{"id":"70dc87d7107eeaffc5848b48042d430f","parent_id":null,"user_id":null}},"input_select.dryer_status":{"entity_id":"input_select.dryer_status","state":"Off","attributes":{"options":["Off","On"],"editable":true,"icon":"mdi:tumble-dryer","friendly_name":"Dryer Status"},"last_changed":"2022-02-01T00:40:53.688969+00:00","last_updated":"2022-02-01T00:40:53.688969+00:00","context":{"id":"686d163f32172e7c437b08debe1e5047","parent_id":null,"user_id":null}},"input_select.destination":{"entity_id":"input_select.destination","state":"Innovior","attributes":{"options":["ANAF 284","Gordon Crane / Music Folders","Home","Innovior","Janet Lang","May's Home","May's Work","My House Design","Safe Harbour Informatics","Select Express","Thirsty Duck","Tugboat Annie's","Walmart"],"editable":true,"icon":"mdi:map-marker-radius-outline","friendly_name":"Destination"},"last_changed":"2022-02-01T00:41:29.420847+00:00","last_updated":"2022-02-01T00:41:29.420847+00:00","context":{"id":"a1f413e25bbbff21e0d2e080b71ab7f1","parent_id":null,"user_id":null}},"media_player.browser_mod_e11f3fb6_438343f8":{"entity_id":"media_player.browser_mod_e11f3fb6_438343f8","state":"idle","attributes":{"volume_level":1,"is_volume_muted":false,"media_content_id":"","type":"browser_mod","deviceID":"e11f3fb6-438343f8","supported_features":21005},"last_changed":"2022-02-01T00:40:53.969332+00:00","last_updated":"2022-02-01T00:40:53.969332+00:00","context":{"id":"48a9c0975a2f1029812b13900fd66f1f","parent_id":null,"user_id":null}},"light.browser_mod_e11f3fb6_438343f8":{"entity_id":"light.browser_mod_e11f3fb6_438343f8","state":"on","attributes":{"supported_color_modes":["onoff"],"color_mode":"onoff","type":"browser_mod","deviceID":"e11f3fb6-438343f8","last_seen":"2022-01-31T23:21:58.108545","supported_features":0,"templates":{"icon":"if (state == 'on') return 'mdi:lightbulb'; return 'mdi:lightbulb-outline';\n"}},"last_changed":"2022-02-01T00:40:53.970246+00:00","last_updated":"2022-02-01T07:21:58.109175+00:00","context":{"id":"8b02f27a7c85f7f1ef8933ede3d46390","parent_id":null,"user_id":null}},"sensor.browser_mod_e11f3fb6_438343f8":{"entity_id":"sensor.browser_mod_e11f3fb6_438343f8","state":"3","attributes":{"type":"browser_mod","last_seen":"2022-02-01T01:42:28.086735","deviceID":"e11f3fb6-438343f8","path":"/a0d7b954_nodered/dashboard","visibility":"visible","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.76","currentUser":"Daniel","fullyKiosk":false,"width":2400,"height":1161,"battery_level":100,"charging":true,"darkMode":false,"userData":{"id":"7c824b7712954da39c719cddefae9008","name":"Daniel","is_owner":true,"is_admin":true,"credentials":[{"auth_provider_type":"homeassistant","auth_provider_id":null},{"auth_provider_type":"trusted_networks","auth_provider_id":null}],"mfa_modules":[{"id":"totp","name":"Authenticator app","enabled":true}]},"config":{"command":"update"}},"last_changed":"2022-02-01T09:31:55.615381+00:00","last_updated":"2022-02-01T09:42:28.087168+00:00","context":{"id":"620985334addfca9f743779e16815377","parent_id":null,"user_id":null}},{"id":"c10294786c5b4035b6fba071db7cd111","parent_id":null,"user_id":null}}},

For the node in question the path is

homeAssistant.states["input_number.bathroom_minimum_turn_on"].state

which is contained in Global homeassistant
Copy value from input_number.bathroom_minimum_turn_on: object is{"entity_id":"input_number.bathroom_minimum_turn_on","state":"15.0","attributes":{"initial":null,"editable":true,"min":0,"max":100,"step":1,"mode":"box","friendly_name":"Bathroom Minimum Turn On"},"last_changed":"2022-02-01T00:40:52.260705+00:00","last_updated":"2022-02-01T00:40:52.260705+00:00","context":{"id":"5bfc5ebe13144f35c79697083fc4bd90","parent_id":null,"user_id":null}}

Copy path from state is homeAssistant.states["input_number.bathroom_minimum_turn_on"].state
Copy value from state is 15.0

I think I finally found the secret combo...

[{"id":"c398413f.ac67a","type":"switch","z":"a12b6ffa.5393c","name":"<minimum?","property":"nr_circadian_brightness","propertyType":"global","rules":[{"t":"lt","v":"$globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state')","vt":"jsonata"},{"t":"gte","v":"$globalContext('homeassistant.homeAssistant.states[\"input_number.bathroom_minimum_turn_on\"].state')","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":665,"y":193,"wires":[["b070924f.3df56","c1c3436d071a208d"],["7c0d078b.390718","1109b986f29cc896"],["6d62a292c9b1c6ac"]]}]

This also succeeds:

image

It would seem that $number() was screwing it up.

It is still evaluating against a string.
You can append .$number() to the jsonata expression.

That causes it to execute my Otherwise condition...

$globalContext('homeassistant.homeAssistant.states["input_number.bathroom_minimum_turn_on"].state').$number()

Did you also add .$number() to the property field ?