Using "Heater" type / Determining variables sent from Vera

Hi guys,

I started to play around with a new sketch to control a gas heater i have. My idea is to use Vera’s “heater” device to control a heater which currently only has 4 phyisical switches. ON/Off, Gas H/L, Fan low/med ,Fan Med/High.

Im my quick sketch i can create the device “S_Heater” and send messages back to vera using “V_HEATER” and “V_HEATER_SW”, so i can report back to vera whats happening…but i also need to control the Arduino from Vera.

If i click any of the buttons on the Heater device in Vera…i get the “Not Implemented” message.

I have a listen for message section: eg:

 if (gw.messageAvailable()) {
    message_s message = gw.getMessage(); 
    setRelayStatus(message);
  }

But ive no idea how to determine what messages to expect from Vera… I tried putting a Serial.println(message); but the Arduino IDE didnt like it…

Is there a “how to” to determine the messages sent from Vera?

The “Not Implemented” message in vera indicates that the sending of the commands from the buttons are not yet implemented in the Vera plugin. You need to add this functionality to the Vera plugin first. The first clue of what is missing should be found from the vera log. Try to capture the log entries from when you push the buttons.

Yes,

Tomas did a similar addition for the lock-device. Have a look here what additions he made:

Would be great if you considered sharing your additions. See how to contribute here: What's all the fuss about? | MySensors - Create your own Connected Home Experience

Ah ok… now ill try getting off my lazy chair :stuck_out_tongue: and fix this one!

If I can do it, anyone can. The hardest part is to get out of that lazy chair and finding time to allocate to it.

I can try to help you gregl through this thread if you like. First you need to capture the log from Vera then we need to figure out what to add to the files two files L_Arduino.lua and I_Arduino1.xml.

Thanks Tomas/Hek,

Ive just had a quick go at it and SUCCESS! - i can now use the heater device for both setting the required Temp and ON/OFF.

Its bed time now for me…but ill wrap it all up tomorrow hopefully with a sketch and share it here…

Wow gregl that was fast, you must have some coding experience since it took a few days for me to get the lock device working.

back again…
No real coding skills…but pretty got at cut n’ paste and uploading 10000x times to test it!

Ive submitted pull request for Hek to commit the required vera plugin changes in github…
but here is the sketch working…albeit without the included temp sensor code in the sketch. (my pc crashed and i lost those changes)

What really had me stumpted for a while was testing against the message.data coming from vera!
message.data for turning the heater on is “HeatOn”
so i was doing something like

[code]
if (message.data == “HeatOn”) {
//startit
}

[code]

bloody thing wouldnt match!!!..pulled soooo much hair out!!

tried 1000000 things and worked out its not a simple string…
Anyway this worked:

if  (strncmp(message.data,"HeatOn",6) == 0)

this code basically tries to compare message.data which looked in Serial.print as “HeatOn” …but it wasnt a string its a char array or something! …anyway some googling and i found that function

Hi gregl,

Would you mind sharing a screen shot of the vera heater device? I’m working on a sketch to control the speed of the fan in my ventilation system using 4 relays and I would like to avoid using 4 light switches if I can find some other suitable device. According to your description it seems like the heater device would be an option.

regards,
tomas

Hi Tomas,

see attached . it uses D_Heater1.xml

why not use a dimmer ? so you get the slider control. if you motor only allows for 3 or 4 speeds then map in the sketch a dim level of 0-10 as off, 11-25 low, 26-50 as mid, 50-100 as high ( or whatever ) then set relays on at each value.

One benefit of doing this is that 3rd party apps will know all about the dimmer device type ( not many seem to have the heater!)

Greg

You are so right about the dimmer. Why did I not think of that. Thanks gregl