Hi,
The whole thing has been a bigger job than I thought, make sure you know exactly what’s going on with your existing wiring and controller.
You’ll possibly find that one of the elements (usually the higher up one) is only used for the manual boost. The lower one is probably the one that is connected to the timer and the one thats the one you could replace the thermostat with a tsmart.
You need to make sure you have an existing plugin type thermostat (lucky) otherwise you’ll need to change the heating element too - which is a total pain.
The t-smart performs the same function as the existing timer, so you’ll need to make sure you can bypass it either through re-wiring or by some kind of manual override mode (mine didn’t have this so had to rewire).
Anyway, I have 3 flows.
You’ll need to install timed-counter
, buffer-parser
and buffer-maker
-
Discovery Flow (not needed if you already know its IP). Really simple, sends broadcast and listens for responses just so you can get the IP.
[{"id":"78b52a5fd8e10db1","type":"tab","label":"Discovery","disabled":false,"info":""},{"id":"34c90cb5.cb36f4","type":"inject","z":"78b52a5fd8e10db1","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"[\"0x01\",\"0x00\",\"0x00\",\"0x54\"]","payloadType":"bin","x":110,"y":60,"wires":[["f5e46a5f51ae1547"]]},{"id":"ea88865c.157778","type":"debug","z":"78b52a5fd8e10db1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":310,"y":160,"wires":[]},{"id":"a43fe2e7.5bc02","type":"udp in","z":"78b52a5fd8e10db1","name":"listener","iface":"","port":"1337","multicast":"false","group":"","datatype":"buffer","x":110,"y":160,"wires":[["ea88865c.157778"]]},{"id":"f5e46a5f51ae1547","type":"udp out","z":"78b52a5fd8e10db1","name":"","addr":"255.255.255.255","iface":"","port":"1337","ipv":"udp4","outport":"","base64":false,"multicast":"broad","x":380,"y":60,"wires":[]}]
-
Control Read Flow.
This polls every minute and gets current temp, setpoint, mode and updates a HA Sensor. It fires HA events if it receives unexpected responses or no response within a threshold.
You’ll need to manually change the IP in both the ‘Poll For Data’ and ‘Check Source IP’ nodes.
[{"id":"1fc40438f9fe75ed","type":"tab","label":"Control Read","disabled":false,"info":""},{"id":"2e1c0fa8d82569ba","type":"udp out","z":"1fc40438f9fe75ed","name":"Poll for data","addr":"10.10.5.110","iface":"","port":"1337","ipv":"udp4","outport":"","base64":true,"multicast":"false","x":590,"y":80,"wires":[]},{"id":"c9aca543179cf1bb","type":"debug","z":"1fc40438f9fe75ed","name":"Right IP","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":360,"y":300,"wires":[]},{"id":"feb781e2e3583eeb","type":"udp in","z":"1fc40438f9fe75ed","name":"Listen for UDP messages","iface":"","port":"1337","multicast":"false","group":"","datatype":"buffer","x":130,"y":200,"wires":[["541dcaec636fc5c9"]]},{"id":"1c5b4eca3f950738","type":"buffer-parser","z":"1fc40438f9fe75ed","name":"Extract Data from Payload","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"current_water_temperature","offset":7,"length":1,"offsetbit":0,"scale":"0.1","mask":""},{"type":"int16le","name":"set_point","offset":4,"length":1,"offsetbit":0,"scale":"0.1","mask":""},{"type":"bool","name":"currently_heating","offset":9,"length":1,"offsetbit":0,"scale":"0.1","mask":""},{"type":"int8","name":"mode","offset":6,"length":1,"offsetbit":1,"scale":"1","mask":""},{"type":"bool","name":"power","offset":3,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1040,"y":340,"wires":[["5a6fa54890c73917"]]},{"id":"0c7414361f244a1c","type":"debug","z":"1fc40438f9fe75ed","name":"Wrong IP","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":360,"y":440,"wires":[]},{"id":"5a6fa54890c73917","type":"ha-entity","z":"1fc40438f9fe75ed","name":"Water Heater Entity","server":"e421a022.94f95","version":1,"debugenabled":true,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Water Heater"},{"property":"device_class","value":"temperature"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"°C"}],"state":"payload.current_water_temperature","stateType":"msg","attributes":[{"property":"set_point","value":"keyvalues.set_point","valueType":"msg"},{"property":"currently_heating","value":"keyvalues.currently_heating","valueType":"msg"},{"property":"mode","value":"keyvalues.mode","valueType":"msg"},{"property":"power","value":"keyvalues.power","valueType":"msg"},{"property":"timestamp","value":"","valueType":"date"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1290,"y":340,"wires":[[]]},{"id":"541dcaec636fc5c9","type":"switch","z":"1fc40438f9fe75ed","name":"Check Source IP","property":"ip","propertyType":"msg","rules":[{"t":"cont","v":"10.10.5.110","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":150,"y":400,"wires":[["c9aca543179cf1bb","be7391beaa4c5512","ad4e5d81e72ed905"],["0c7414361f244a1c"]]},{"id":"d89a28c6942353b1","type":"switch","z":"1fc40438f9fe75ed","name":"Sort messages","property":"message_type","propertyType":"msg","rules":[{"t":"eq","v":"242","vt":"str"},{"t":"eq","v":"241","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":700,"y":380,"wires":[["ebb18dab196e65a3"],["1a83749f573f2c55","1c5b4eca3f950738"],["b2d07716ece50533"],["78fce09ab96671a2","e81f80cdb8de371c"]]},{"id":"1a83749f573f2c55","type":"debug","z":"1fc40438f9fe75ed","name":"Control Read","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":300,"wires":[]},{"id":"ebb18dab196e65a3","type":"debug","z":"1fc40438f9fe75ed","name":"Acknowledge Set","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":220,"wires":[]},{"id":"78fce09ab96671a2","type":"debug","z":"1fc40438f9fe75ed","name":"Other Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1000,"y":540,"wires":[]},{"id":"b2d07716ece50533","type":"debug","z":"1fc40438f9fe75ed","name":"Discovery Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":420,"wires":[]},{"id":"be7391beaa4c5512","type":"change","z":"1fc40438f9fe75ed","name":"Add Message Type to payload","rules":[{"t":"set","p":"string","pt":"msg","to":"$string(payload)","tot":"jsonata"},{"t":"set","p":"message_type","pt":"msg","to":"$substringBefore(($substringAfter($string(payload), \"[\")), \",\")\t\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":380,"wires":[["d89a28c6942353b1"]]},{"id":"f34c37228774a5f5","type":"trigger","z":"1fc40438f9fe75ed","name":"Watchdog","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"4","extend":true,"overrideDelay":false,"units":"s","reset":"ok","bytopic":"all","topic":"topic","outputs":1,"x":590,"y":140,"wires":[["3b24d406dcb041ef","51b0d9629ab2efda"]]},{"id":"3b24d406dcb041ef","type":"debug","z":"1fc40438f9fe75ed","name":"Timeout","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":780,"y":80,"wires":[]},{"id":"ad4e5d81e72ed905","type":"change","z":"1fc40438f9fe75ed","name":"Reset Timeout","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":340,"wires":[["f34c37228774a5f5"]]},{"id":"2bcef42beed38c27","type":"change","z":"1fc40438f9fe75ed","name":"Get Control Data Message","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\"0xF1\",\"0x00\",\"0x00\",\"0xA4\"]","tot":"bin"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":80,"wires":[["f34c37228774a5f5","2e1c0fa8d82569ba"]]},{"id":"a80f90c2f7c7de50","type":"inject","z":"1fc40438f9fe75ed","name":"Start","props":[],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":90,"y":80,"wires":[["2bcef42beed38c27"]]},{"id":"28d7afb9ddb08b9d","type":"link in","z":"1fc40438f9fe75ed","name":"Trigger Control Read","links":["3a25ecaf84b56af1"],"x":115,"y":40,"wires":[["2bcef42beed38c27"]]},{"id":"610123ca9f119dc0","type":"ha-fire-event","z":"1fc40438f9fe75ed","name":"Fire event","server":"e421a022.94f95","version":0,"event":"water_heater","data":"{\"message\":\"Multiple timeouts waiting for response from water heater\",\"event\":\"water_heater_timeout\"}","dataType":"json","x":1280,"y":140,"wires":[[]]},{"id":"e81f80cdb8de371c","type":"ha-fire-event","z":"1fc40438f9fe75ed","name":"Fire event","server":"e421a022.94f95","version":0,"event":"water_heater","data":"{\"message\":\"Unexpected response from water heater\",\"event\":\"water_heater_unexpected_message\"}","dataType":"json","x":980,"y":580,"wires":[[]]},{"id":"51b0d9629ab2efda","type":"timed-counter","z":"1fc40438f9fe75ed","name":"Count how many in hour","timelimit":"1","timeunit":"3600000","withhold":true,"fixedtimeout":true,"pertopic":false,"x":830,"y":140,"wires":[["d7977e1f8ecbe0c5","d132cbb19dca0d85"]]},{"id":"d7977e1f8ecbe0c5","type":"switch","z":"1fc40438f9fe75ed","name":"Ignore less than 5","property":"count","propertyType":"msg","rules":[{"t":"gte","v":"5","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1090,"y":140,"wires":[["610123ca9f119dc0"]]},{"id":"d132cbb19dca0d85","type":"debug","z":"1fc40438f9fe75ed","name":"How many in hour","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1090,"y":80,"wires":[]},{"id":"e421a022.94f95","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":true,"cacheJson":false}]
-
Set Mode
This sends the correct commands to the tsmart based on a HA input_select
value then sends a control read message 5 seconds later so that the HA sensor updates.
[{"id":"b71a44ceba3ffd03","type":"tab","label":"Set Mode","disabled":false,"info":""},{"id":"9cb5333dec234544","type":"server-state-changed","z":"b71a44ceba3ffd03","name":"","server":"e421a022.94f95","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select.set_water_heater_mode","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"Unknown","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":100,"wires":[["d7af9c82e3e9621c"],[]]},{"id":"d7af9c82e3e9621c","type":"switch","z":"b71a44ceba3ffd03","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Manual","vt":"str"},{"t":"eq","v":"Eco","vt":"str"},{"t":"eq","v":"Smart","vt":"str"},{"t":"eq","v":"Timer","vt":"str"},{"t":"eq","v":"Travel","vt":"str"},{"t":"eq","v":"Boost","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":110,"y":340,"wires":[["be5e249b2c902efb"],["2922f7982e0cbb2f"],["521e7d06cc8361c3"],["c6b37cbd7be0c22b"],["d7bb1c1a621851af"],["dce7771264f4654c"]]},{"id":"04476f015d24a303","type":"debug","z":"b71a44ceba3ffd03","name":"Manual","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":780,"y":160,"wires":[]},{"id":"bf4daa8238bb7c3d","type":"debug","z":"b71a44ceba3ffd03","name":"Eco","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":200,"wires":[]},{"id":"f78405b6ee4af33d","type":"debug","z":"b71a44ceba3ffd03","name":"Smart","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":240,"wires":[]},{"id":"0eb495607782c939","type":"debug","z":"b71a44ceba3ffd03","name":"Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":280,"wires":[]},{"id":"d4730152357b618c","type":"debug","z":"b71a44ceba3ffd03","name":"Travel","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":320,"wires":[]},{"id":"cb22f9ebda9da02f","type":"debug","z":"b71a44ceba3ffd03","name":"Boost","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":360,"wires":[]},{"id":"521e7d06cc8361c3","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Smart","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x02\",\"0xA4\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":330,"y":320,"wires":[["f78405b6ee4af33d","44594dedab724b5b","198b263155498a94"]]},{"id":"2922f7982e0cbb2f","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Eco","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x01\",\"0xA7\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":330,"y":280,"wires":[["bf4daa8238bb7c3d","44594dedab724b5b","198b263155498a94"]]},{"id":"be5e249b2c902efb","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Manual","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x00\",\"0xA6\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":340,"y":240,"wires":[["04476f015d24a303","44594dedab724b5b","198b263155498a94"]]},{"id":"d7bb1c1a621851af","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Travel","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x04\",\"0xA2\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":330,"y":400,"wires":[["d4730152357b618c","44594dedab724b5b","198b263155498a94"]]},{"id":"dce7771264f4654c","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Boost","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x05\",\"0xA3\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":330,"y":440,"wires":[["cb22f9ebda9da02f","44594dedab724b5b","198b263155498a94"]]},{"id":"c6b37cbd7be0c22b","type":"buffer-maker","z":"b71a44ceba3ffd03","name":"Buffer Maker Timer","specification":"spec","specificationType":"ui","items":[{"name":"item2","type":"buffer","length":8,"dataType":"bin","data":"[\"0xF2\",\"0x00\",\"0x00\",\"0x01\",\"0x00\",\"0x00\",\"0x03\",\"0xA5\"]"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":330,"y":360,"wires":[["0eb495607782c939","44594dedab724b5b","198b263155498a94"]]},{"id":"44594dedab724b5b","type":"udp out","z":"b71a44ceba3ffd03","name":"Send To Device","addr":"10.10.5.110","iface":"","port":"1337","ipv":"udp4","outport":"","base64":true,"multicast":"false","x":800,"y":440,"wires":[]},{"id":"198b263155498a94","type":"delay","z":"b71a44ceba3ffd03","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":600,"y":500,"wires":[["3a25ecaf84b56af1"]]},{"id":"3a25ecaf84b56af1","type":"link out","z":"b71a44ceba3ffd03","name":"Trigger Control Read","links":["28d7afb9ddb08b9d"],"x":735,"y":500,"wires":[]},{"id":"e421a022.94f95","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":true,"cacheJson":false}]
Hope this helps.
Amanda