YAML configuration for eCoal Heater

Hi,

I have a coal heater, what would like to control by my HA. To read values I use Rest sensor and this is working.

This code let me read values. Now I am trying to send a command. To do that I need to somehow trigger URL.

I am trying to define action for that and trigger it when value of assistant is changed

So I defined Rest_Command. How can I send there Temperature value?

I am completly new with that language, so cannot understand yet how it works and official description says me nothing (really, they could place some examples with displaying how it influence entities and so on in practice...).

Codes:

Rest:
 - authentication: basic
   username: XXXX
   password: YYYYYYY
   
   scan_interval: 30
   resource: http://192.168.AAA.BBB/getregister.cgi?device=0&fuel_level&tpow_value&tkot_value&kot_tzad&ob1_zaw4d_tzad&t1_value&next_fuel_time      
   sensor:
    # Odczyt poziomu paliwa
    - name: Poziom paliwa
      unique_id: eCoal_Poziom_paliwa
      value_template: '{{ value_json["cmd"]["device"]["reg"][0]["@v"] }}'
      unit_of_measurement: "%"

rest_command:
  ustaw_temp_kotla:
    url: >-
      http://XXXX:[email protected]/setregister.cgi?device=0&kot_tzad={{ temperatura }}
    method: GET

It looks like you have already set up a REST command, so there should be a corresponding Action available in your automations and scripts. You can use the Actions tool to test it. If you don't see the action in the Action tool or the Action selector of the automation editor, restart Home Assistant to make sure it has been loaded, then check your logs for any errors.

So, in YAML your action will be something like:

action: rest_command.ustaw_temp_kotla
data:
  temperatura: 30

The REST command docs do have an example of using an action with data variables.

Thanks for answer. I would like to send various value setted in the HA. Was trying sth like that:

rest_command:
  ustaw_temp_kotla:
    url: >-
      http://XXX:[email protected]/setregister.cgi?device=0&kot_tzad={{ states.counter.zmien_temperature_zadana_kotla }}
    method: GET

and I created automation what is triggered every time when assistant "zmien_temperature_zadana_kotla" change the value. And there I am trying to trigger this rest_command.

Ok, I found the way so will show it in case somebody have the same problem.

At 1st rest_command definition

rest_command: 
    ustaw_temp_kotla:
     username: !secret eCoal_username_admin
     password: !secret eCola_password_admin
     url: >-
      http://192.168.AAA.BBB/setregister.cgi?device=0&kot_tzad={{ states('counter.zmien_temperature_zadana_kotla') }}
     method: GET

counter.zmien_temperature_zadana_kotla is an assistant from HA

And then normal autiomation defined:

Here I used if any state change to any state, then trigger defined rest_command.