Change Heating Temp of a group of heaters with CLI

Hi,

i have the homegear binding to some HM-CC-RT-DN devices running in OH3.
This works at the moment :wink:
2 Questions:
1.) How can i create a group of heaters, so with one Knob all of them will go to the desired temperature?
2.) Is it possible, to change such a group of heatings by cli command on the running linux?

Greetimgs from north of germany

Bfo

Look for examples of using Groups of Items with commands e.g. a group of dimmers is the same situation.

You can send commands to openHAB Items (or Groups) from external services using REST API.

Hmmm… REST APi from CLI … maybe… where can i find some examples to interact with the heaters?

Bfo

Search button at top of this forum.

See also docs

Hello rosske57,

the docs for the API are short :wink:
How do i know the item to set the temperature. I have tryed this:

(bash shell script)

openHAB_IP=localhost

curl -X GET --header "Accept: application/json" "http://{openHAB_IP}:8080/rest/items?recursive=false"
// i get every things in json echo'ed, so the api is working

curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "25" "http://${openHAB_IP}:8080/rest/items/homematic:HG-HM-CC-RT-DN:3d09dc56c8:LEQ0785626:4#SET_TEMPERATURE"
//No output, nothing is happen

The heater thing ID is: homematic:HG-HM-CC-RT-DN:3d09dc56c8:LEQ0785626
The Item looks like the attached picture.

How can i set the temperature of this item?

Best regards

Bfo

The Name of the item is shown at the top of your screenshot :

HZOGSued_SetTemperature

Your script ist trying to use the ThingID plus channel name as item name, which cannot work.

Perhaps approach this differently.
How would you do that from a regular openHAB UI with a click?
What does that actually “do” to the Item?
How can you simulate the same action with REST API?

Hi,
dont forget: i’m a beginner and do not know, a lot about OH3.
I am thankfull for your help, but i dont want to know everything about this system. I dont want to be a develper or something. It should just work an nothing more. If it is just running, then I have get my solution. It is for me not neccessary, to know, “why” its working. Just work.

Other “ready to use” solutions does this. I know, it is not open Sourec and and and… but i need a working solution. Now. All my heaters - i dont know why - get every morning to 25 degrees (Celcius).
Homegear should connect to the thermostate and let it use in OH, but nothing more. I cannot chane the defaults or update the firmware.

On CLI output of the thermostate (with homegerar) it shows similar - but not the same - values like in OH, Thing, Code.

Also: the heater widget in OH is very unhappy. If i want to change the temperature from 25 to 15, i must klick 20 times to “down” (in 0,5 degress steps) - but the temeprature jumps sometimes back to the previous value. Thats the reason, why i should try the CLI / Rest Api.

I have no idea.

I had try this:

#!/bin/bash

openHAB_IP=localhost

curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "25" "http://${openHAB_IP}:8080/rest/items/homematic:HZOGSued_SetTemperature"

But nothing happen.No output, no errors.

Bfo

Is this a problem, something unexpected? You would be better to fix that first before adding more complications.

That’s not an Item name, so it is not going to do much.

The screenshot you showed us earlier had an Item name of HZOGSud_SetTemperature. No homematic text, no colon.

1 Like

Yes, because i had set everything to 8 degrees - all the time (at the moment i change it by hand if neccessary). If everything is fine, i will go on with automation the heaters from OH on times or events.

So i tried this command:

openHAB_IP=localhost
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "25" "http://${openHAB_IP}:8080/rest/items/HZOGSued_SetTemperature

but also: nothing happen. no changes, no output.

Bfo

Slow down. Fix your problem with the fairies turning up your heating in the night before you introduce more complications.

Then get something working using an openHAB UI before messing about with CLI commands. Why do you want that anyway?

Like i wrote, in OH gui I can change the heaters temperature. It works! Only the widget jumps sometimes back to the previous temperature (for example: it is 20 > klick 2 times - 19,0 (…jumps back to 20 or 19,5).
But the thermostate goes urgently to the value, waht was set in gui. This works.
Next step is the cli. I need it for remote automation without gui (example: send an command to OH via ssh).

Bfo

What is the name of the Item that you do that to?
You need to know that for REST use.
What is the type of this Item?
You need to know that to send the right data in REST.

Hint - look in your openHAB events.log and you can see what commands are sent where, when you click in UI.
This is what you are trying to reproduce.

Squinting at your screenshot, the names is HZOGSud_SetTemperature, and the type is Number:Temperature
That is important, because it means you must send commands with units, like “18°C”

1 Like

Very important hint. Thank you.
I think - the values should be sent without “°C” (see my log)
If I click in the Gui to chaneg a temperature, i see in the log this:

2021-10-21 13:01:19.135 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HZEGSchlafzimmergross_SetTemperature' received command 5.5
2021-10-21 13:01:19.137 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HZEGSchlafzimmergross_SetTemperature' predicted to become 5.5
2021-10-21 13:01:19.139 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HZEGSchlafzimmergross_SetTemperature' changed from 6 °C to 5.5 °C

In this case, the heater/thermostate name is “HZEGSchlafzimmergross_SetTemperature”. So far so good. but with the cli, nothings happns (in the log) with

openHAB_IP=localhost
curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "25" "http://${openHAB_IP}:8080/rest/items/HZEGSchlafzimmergross_SetTemperature"

if i open http://[ip]:8080/rest/items/ i get everything as josn output, also the thermostate above.
So, the basic things seems to work.

Bfo

Part of the hole json output of the item:

{"link":"http://192.168.1.108:8080/rest/items/HZEGSchlafzimmergross_SetTemperature","state":"5.5 °C","stateDescription":{"minimum":4.5,"maximum":30.5,"step":0.1,"pattern":"%.2f %unit%","readOnly":false,"options":[]},"editable":true,"type":"Number:Temperature","name":"HZEGSchlafzimmergross_SetTemperature","label":"Set Temperature","category":"Temperature","tags":["Point"],"groupNames":["HZEGSchlafzimmergross"]}

Forget my last Post.

I had look into the Rest api again and see… i should send it via POST, not PUT - the command works now.

THANK YOU VERY MUCH!!!

Bfo

That might be contributing to your problems. The UI is sending bad commands to a Number:Temperature type.
There is a MainUI bug where it doesn’t properly handle metadata ‘pattern’ %unit%. Change that to °C and see if it helps.

You need to find out the response - nobody said using CLI was the easy way to go. What authorization are you using?