I’ve been using HA and NodeRed for a while and have managed to stumble my way through creating flows to achieve various things in my system, but my knowledge of how it all works is very basic.
I have a solar system and a car charger, which through other people’s integrations, have figured out how to do various things. What I am trying to achieve is as follows:
If the solar has charged the house battery to 100% the extra exported power is then sent to the car charger. I can force the battery to discharge at any percentage using api commands, which exports any excess the house isnt using, which then turns the car charger on. I want to create a button or switch that is on the dashboard that runs the flow to discharge the battery, or if its discharging, then run a flow which turns the charger off. Ive managed to create a switch with the NodeRed companion before, but Im not sure how to then show or make it display that the flow is “running” and have that show up in the dashboard next to the button. Basically a status display… running or not. Do i need to create a sensor for this? Any help would be appreciated.
This is how the flow works at the moment.
[{"id":"5fa9b2190f71500d","type":"function","z":"acd270e61de58271","name":"API- Op Mode - Manual","func":"msg.payload = \"EM_OperatingMode=1\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = '1f6ff39a-8c6d-44c7-9020-9ed9f0c9f9a3'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":300,"wires":[["4e4b76acff30e347"]]},{"id":"4e4b76acff30e347","type":"http request","z":"acd270e61de58271","name":"Set Man","method":"PUT","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.48/api/v2/configurations","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1340,"y":300,"wires":[["76fdffa2ef8e85a6"]]},{"id":"a476ef83da02c6bb","type":"http request","z":"acd270e61de58271","name":"disCharge Value","method":"POST","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.48/api/v2/setpoint/discharge/3300","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1800,"y":300,"wires":[[]]},{"id":"76fdffa2ef8e85a6","type":"function","z":"acd270e61de58271","name":"API- disCharge Value","func":"msg.payload = \"3600\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = '1f6ff39a-8c6d-44c7-9020-9ed9f0c9f9a3'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1560,"y":300,"wires":[["a476ef83da02c6bb"]]},{"id":"1ca7a82463619b9d","type":"api-current-state","z":"acd270e61de58271","name":"Connector Status","server":"97795d95.ce311","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.car_charger_connector_status","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","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":300,"wires":[["2c3a750d083e8cbe"]]},{"id":"2c3a750d083e8cbe","type":"switch","z":"acd270e61de58271","name":"Check Charger Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"SUSPENDED_EVSE","vt":"str"},{"t":"eq","v":"CHARGING","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":640,"y":300,"wires":[["5fa9b2190f71500d"],["0f204f06fbc221fc"],["ad0f42f9d15228fa"]]},{"id":"782690cf077a8801","type":"function","z":"acd270e61de58271","name":"API- AUTO 2","func":"msg.payload = \"EM_OperatingMode=2\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = '1f6ff39a-8c6d-44c7-9020-9ed9f0c9f9a3'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2130,"y":380,"wires":[["3bd4387df03d2f86"]]},{"id":"3bd4387df03d2f86","type":"http request","z":"acd270e61de58271","name":"Set AUTO","method":"PUT","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.48/api/v2/configurations","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":2300,"y":380,"wires":[[]]},{"id":"0f204f06fbc221fc","type":"function","z":"acd270e61de58271","name":"API- Op Mode - Manual","func":"msg.payload = \"EM_OperatingMode=1\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = '1f6ff39a-8c6d-44c7-9020-9ed9f0c9f9a3'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":380,"wires":[["93344b77b6cdb626"]]},{"id":"93344b77b6cdb626","type":"http request","z":"acd270e61de58271","name":"Set Man","method":"PUT","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.48/api/v2/configurations","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1340,"y":380,"wires":[["5a38bdb03ddd893b"]]},{"id":"5a38bdb03ddd893b","type":"function","z":"acd270e61de58271","name":"API- disCharge Value 0","func":"msg.payload = \"0\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = '1f6ff39a-8c6d-44c7-9020-9ed9f0c9f9a3'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1550,"y":380,"wires":[["a75f995741c7a312"]]},{"id":"c60c160763be3afe","type":"delay","z":"acd270e61de58271","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1960,"y":380,"wires":[["782690cf077a8801"]]},{"id":"a75f995741c7a312","type":"http request","z":"acd270e61de58271","name":"disCharge Value","method":"POST","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.48/api/v2/setpoint/discharge/0","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1780,"y":380,"wires":[["c60c160763be3afe"]]},{"id":"ad0f42f9d15228fa","type":"debug","z":"acd270e61de58271","name":"debug 14","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1080,"y":500,"wires":[]},{"id":"97795d95.ce311","type":"server","name":"Home Assistant","version":5,"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","enableGlobalContextStore":true}]