Creating slider for heating control (values send to shell script)

Hi,

facing another problem, want to control me heating, but the only way ist to execute a bash script with temperature value, but how i get it controlled in HABPanel which sends the selected value to the script ?

The script for setting the temperature looks like:
python3 homematicip_cli.py --group d0be45b0-a5f9-4112-b799-de78270c535a --set-point-temperature 22

i guess the value should stand in a variable, but don’t know how should i begin.

many thanks in advance

Catch the Slider State/Value via REST Api to a Variable… and set this Var in your python command.

A Rule with the Slider as trigger execute the BashScript

Thanxs for the hint, but as newbie i thinks that doesnt help me alot :slight_smile: , a example would be great than i can adapt.

Can somebody create a working example with my named script ?

Here is my Example …

Rule:

rule"Lautstärke Airplay Wohnzimmer einstellen"
when
  Item AP_Volume_Wohnzimmer changed
then
  if (AP_Status_Wohnzimmer.state == ON) {
    executeCommandLine("/etc/openhab2/scripts/oh_itunes-api.sh " + "volume "+ AP_Volume_Wohnzimmer.state + " 18-ee-69-20-a6-2a")
  }
  else {
    AP_Volume_Wohnzimmer.postUpdate(0)
  }
end

Perhaps this works for you:

rule"temperature_control"
when
  Item temperature_item changed
then
  executeCommandLine("python3 homematicip_cli.py --group d0be45b0-a5f9-4112-b799-de78270c535a --set-point-temperature " + temperature_item.state)
end

Thx, tried it, but the rule didnt worked.

If i save the rule file:
21:38:39.188 [WARN ] [del.core.internal.ModelRepositoryImpl] - Configuration model ‘temperature_slider.rules’ is either empty or cannot be parsed correctly!
21:38:39.318 [WARN ] [del.core.internal.ModelRepositoryImpl] - Configuration model ‘temperature_slider.rules’ has errors, therefore ignoring it: [3,3]: no viable alternative at input ‘item’

Rulefile like you said:
rule"hmip_temperature_control_az"
when
item hmip_az_temperature changed
then
executeCommandLine(“python3 /home/pi/homematicip-rest-api/homematicip_cli.py --group d0be45b0-a5f9-4112-b799-de78270c535a --set-point-temperature + hmip_az_temperature.state”)
end

i created a item for the temperature
Number hmip_az_temperature “Arbeitszimmer Temperatur Control [%.1f °C]” (gHMIPTemps) { channel=“homematicip:sensors:temps:aztempcontrol”}

Slider itself is working, but value is from 1 - 100 which makes not much sense, can i set a range ?

No … Slider is 0-100…

Use setPoint…

https://openhabdoc.readthedocs.io/de/latest/setpoint/

Perhaps hmip_az_temperature.state.toString or toInteger ?

I can‘t test it… because i use the Offiziell Binding and no undokument API …

Wrong!

item hmip_az_temperature changed

Right!

Item  hmip_az_temperature changed

Yes used the setPoint, but didnt realy satisfy me, you didnt see a number, only if you are done with pressing… some more guessing … in HABPanel it looks better with the slider, but dont work that good on a smartphone

Yes i know not that fancy, but the only working way without buying a ccu2 and using the HomematicIP Gateway.

Tried both still didnt worked:
rule"hmip_temperature_control_az"
when
Item hmip_az_temperature changed
then
executeCommandLine(“python3 /home/pi/homematicip-rest-api/homematicip_cli.py --group d0be45b0-a5f9-4112-b799-de78270c535a --set-point-temperature + hmip_az_temperature.state.toInteger”)
end

23:15:32.068 [WARN ] [del.core.internal.ModelRepositoryImpl] - Configuration model ‘temperature.rules’ is either empty or cannot be parsed correctly!