Setting the data proprty in a "Call service" node

I am an experienced home automation person and primarily use Homeseer and Vera, but am just learning about HomeAssistant and am a complete newbie with Node-RED. I have Node-RED working on HomeAssistant and am trying to control the Intesis thermostat add-in.

I’m able to use Node-RED to turn the thermostats on and off, but they turn on in “Auto” mode, and I want to turn them on in “Cool” or “Heat” mode specifically. The Intesis add-in is running in the “climate” domain (am I saying that correctly?) and in the Service dropdown menu in Node-RED it shows me an option to call “set_hvac_mode”. I can enter an entity ID to identify which thermostat I want to control - let’s say it’s “climate.mbr”. I assume to complete the configuration properly I need to provide some info in the “Data” field to tell Node-RED which mode I want to use.

I think the add-in will recognize the modes “heat” and “cool” because when I ask the add-in to return status info on my climate devices to me it returns the following json fields:

{"entity_id": "climate.mbr", "state": "off", "attributes": {"hvac_modes": ["heat_cool", "heat", "dry", "fan_only", "cool", "off"],

… and so on

So I assume I need to include in the Node-RED data field the word “cool”. But simply putting the word in the data field doesn’t do anything, whether I define the field as using a JSON format or an Expression format.

So - my two questions are:

  1. Are my assumptions above generally correct, and if not what mistakes am I making?

  2. If they are the correct assumptions, how do I format the Node-RED data field to tell the add-in I want to set the mode to “cool” (or “heat”)?

Thanks in advance for any help you can provide, and sorry if I’m not understanding the basic concepts in Node-RED.

IMO it’s not about NR concepts but about API available dedicated to change settings as well as the device features/limitations.

What exact device are you trying to control? How is it integrated with HA?

Data field json

{
    "hvac_mode": "cool"
}

The docs for the Intesis integration only show set_operation_mode but that could be due to not being updated.

https://www.home-assistant.io/integrations/intesishome/

If you have trouble formatting json, the three dots in the data field will bring you to a page where you can choose visual editor.

image

Wow - this is an active forum. Thanks for the quick replies.

maxym - I agree it’s probably about the API, but I’ve written to the developer of the add-on and he hasn’t responded yet. And I assumed I was making a mistake formatting the Data field, so I thought I would ask.

kermit - thanks for the formatting - I will try that and report back.

Mikefila - thanks, I noticed that but I didn’t understand how to use the Visual editor. I’m sure there are instructions online if I need to do that, but hopefully kermit’s suggestion will work.

kermit - forgot to add that I also noticed the documentation does not seem to be consistent with the options that Node-RED is providing me in the “Service” field. I assume (correctly?) that the add-in tells Node-Red which services it is providing, so the documentation must be out of date.

I formatted the data field as you suggested and got an API error. In the log file I see a message that says “Call-service error. extra keys not allowed @ data[‘0’]”. Does this mean that the add-on is not accepting input, or that the format is not correct? Any thoughts?

Sorry, my mistake, I entered your suggestion into the wrong node. When I entered it into the correct node it worked. I need to call the “set_hvac_mode” after turning the device on for it to take effect.

Thanks for your help. Node-RED is pretty cool, particularly the way it exposes REST endpoints. Makes it incredibly easy for other home automation platforms (like Homeseer) to control HomeAssistant through a REST API.

Thanks again.

@jwshome Still having the main part of my home automation in HomeSeer. I’ m also charmed of HA and the possibilities it provide. (easy building of dashboards, etc.). Now I’m looking for a way to use the HomeSeer devices (z-wave mainly and some rfx controlled things). Did think of doing something with Nodered or mqtt to combine both. What is your experience with this? Did not find to many topics dealing with HA and HomeSeer.
If I wanted to migrate my z-wave devices to HA is it just pulling out the z-wave(usb) controller and have it read in HA?