Using slider for set point thermostat via mqtt topic

hello, i want to setup a slider for my thermostats. it works with z-way and i have a mqtt plugin to send commands. what i want is a slider between 10-28 that get the state from a mqtt topic (zwaymqtt/devices/zwayvdev_zway_8_0_67_1/status) json

{"id":"ZWayVDev_zway_8-0-67-1","title":"Zieltemperatur","icon":"thermostat","type":"thermostat","level":20}

and if i change the slider i want to publish to a mqtt topic (zwaymqtt/devices/zwayvdev_zway_8_0_67_1/set) a json

{ "command": "exact", "args": { "level": 20 } }

can i do that?

  • Set up an input slider.
  • Add an automation that has a trigger on the MQTT topic and action to set the slider value (input_select.select_option)
  • Add an automation with a trigger on the slider state change and action to call mqtt.publish service with value of input slider.


even after reading every more then 1 time i still don’t understand how i could build a slider…
i think i have a big logic problem in my head
i don’t know how i automate a slider to send a different command on every change and i don’t understand how send a specific value via json (what i want to send ({ “command”: “exact”, “args”: { “level”: 20 } } when the slider is set to 20)

Hi,

I have the same issue as luxus, I’m not fully sure how set the payload value of an MQTT request with the value of my slider. I’ve tried the following script:

test_bose_mqtt:
 alias: "MQTT Bose volume"
 sequence:
   service: mqtt.publish
   data:
     topic: "home/bose/volume"
     payload: {{ states('input_slider.sliderbose') }}

but then hass won’t run. Is there something I’m getting wrong?

Can somebody please provide a working example?

For me works like this (one way):

input_slider:
  dhtinterval:
    name: DHT sensor interval. (s)
    initial: 15
    min: 5
    max: 60
    step: 5

automation:    
  - alias: DHT sensor interv. 
    trigger:
      platform: state
      entity_id: input_slider.dhtinterval
    action:
      - service: mqtt.publish
        data_template:
          topic: "wc/switch/bulb/set/command/"
          payload: 'a{{ states.input_slider.dhtinterval.state | int }}'

And the resulted payload (if slider’s value is the initial 15) : a15

3 Likes