Dummy Setpoint to control IR Terrace Heater

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Electrifying
Posts: 2
Joined: Friday 21 June 2024 10:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Dummy Setpoint to control IR Terrace Heater

Post 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!!
User avatar
waltervl
Posts: 5900
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Dummy Setpoint to control IR Terrace Heater

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Electrifying
Posts: 2
Joined: Friday 21 June 2024 10:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy Setpoint to control IR Terrace Heater

Post 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!
Last edited by Electrifying on Sunday 23 June 2024 13:58, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest