Page 1 of 1

Dummy Setpoint to control IR Terrace Heater

Posted: Friday 21 June 2024 10:56
by Electrifying
Hi everyone!

I would like to create a Setpoint device to control an IR Terrace Heater. I chose a Setpoint Device so Homebridge (Homekit) and Google Home can recognise it as a heating device thus making control possible as in telling Siri/Google; "It is cold on the Terrace". :)

The Terrace Heater has a total of 6 heating settings and has the controls set out below. I've already captured the IR-codes in JSON. Tasmota has been installed on a Wemos D1 Mini Pro and i've already tested sending out the codes, so that part is all done. The heater has the following controls (and the accompanying IR-codes):

  • On: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E7807F","DataLSB":"0x18E701FE","Repeat":0}
  • Off: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E700FF","DataLSB":"0x18E700FF","Repeat":0}
  • Up: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E740BF","DataLSB":"0x18E702FD","Repeat":0}
  • Down: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E7C03F","DataLSB":"0x18E703FC","Repeat":0}
  • Max: IrSend {"Protocol":"NEC","Bits":32,"Data":"0x18E730CF","DataLSB":"0x18E70CF3","Repeat":0}

Now for the code part i want to let the Dummy Setpoint behave as follows:

  • If setting the Setpoint value higher than the previous setting it was on = Execute IR-code "Up" via MQTT message to Tasmota
  • If setting the Setpoint value lower than the previous setting it was on = Execute IR-code "Down" via MQTT message to Tasmota
  • If turning the Setpoint off (i believe Google Home and Homekit can both do this) = Execute IR-code "Off" via MQTT message to Tasmota
  • If turning the Setpoint on (i believe Google Home and Homekit can both do this) = Execute IR-code "On" via MQTT message to Tasmota

"Max" will barely, if ever be used so i have no particular need for that code to function with the Setpoint device. I also don't know how to make that setting work with the Setpoint device because i believe the above settings will use up all the functions of the Setpoint Device.

I tried to find out how i can compare a new value with the "current" value with DZvents, but i've only found explanations regarding time.

Could someone help me with a DZvents script to get the above working? Thanks!!

Re: Dummy Setpoint to control IR Terrace Heater

Posted: Friday 21 June 2024 19:52
by waltervl
I don't think this will be easy because dzvents normally does not know the previous value. So you have to store the current value in a persistent variable. The next time the script is triggered you can compare it with the current value with the previous stored value.

Re: Dummy Setpoint to control IR Terrace Heater

Posted: Sunday 23 June 2024 13:57
by Electrifying
Thank you Walter for your answer!

Can you help me create a script or do you have specific pointers so i can create one myself? It think storing the value as a user variable like e.g every 10 seconds is useable :).

Right now, for the time being. I've created a selector switch with the Websocket commandlets. Works perfectly fine, but the Selector Switch doesn't play nicely with Homebridge. It is simply being recognised a switch in which you can program what the buttons will do (like every other Domoticz Selector Switch in Homebridge) . But ofcourse that has already been configured.

I can create 5 separate buttons and just group them together in Homekit, but then Homekit does not know what kind of device it is. The key in this configuratie is that the Terrace heater is being recognised as a Heating device :).

Thanks again!