Not sure if I do it right.
I have a “State node” that read value of battery of a android and I think it works fine because I have no problem to see the level of the battery.
after that I have a “switch node” that I have two output “less 10” and “more 90” so when it less then 10 it go to 1 and more then 90 it go to 2.
In the end I have two “call service node” that turn on or off smart plug.
But it feel it have to almost go to 1% before it turn on and that is strange.
[{"id":"56e790f80f179c28","type":"switch","z":"fa942904c6ebce60","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"10","vt":"str"},{"t":"gt","v":"90","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":1060,"wires":[["d59521c3a7c4223b"],["ba792c1f924d5430"]]},{"id":"d59521c3a7c4223b","type":"api-call-service","z":"fa942904c6ebce60","name":"","server":"c6db8650.76fe48","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":["35e090e8b0db5e2236bcf722583191e9"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":1000,"wires":[[]]},{"id":"ba792c1f924d5430","type":"api-call-service","z":"fa942904c6ebce60","name":"","server":"c6db8650.76fe48","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_off","areaId":[],"deviceId":["35e090e8b0db5e2236bcf722583191e9"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":1100,"wires":[[]]},{"id":"3b329e41dbdc86a8","type":"server-state-changed","z":"fa942904c6ebce60","name":"","server":"c6db8650.76fe48","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.lenovo_tab_m10_battery","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":240,"y":1080,"wires":[["56e790f80f179c28"]]},{"id":"c6db8650.76fe48","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]