Send URL with sensor value

Continuing the discussion from Reading sensor value with using a variable name:

I am trying to send a URL to an Arduino R4 Wifi to display on its matrix.the value of my Solaredge home battery.

In the configuration.yaml I added the lines:

rest_command:
  rest_cmd_matrix:
    url: "http://192.168.178.x/accu=sensor.{{ states.solaredge_i1_b1_state_of_energy.state }}"

So far no luck. The return value is always “http://192.168.178.x/accu=0

states.*sensor*.solaredge...

url: “http://192.168.178.134/accu=sensor.{{ states.sensor.solaredge_i1_b1_state_of_energy.state }}” does not work.
Are you sure about the asterisks? Shown here as italics.

The asterisks were just for emphasis :joy:
No, you definitely don’t want them

Sorry, my mistake, The syntax is still a puzzle to me.
Now the command is:

url: "http://192.168.178.134/accu=sensor.{{ states.sensor.solaredge_i1_b1_state_of_energy.state }}"

But the variable still returns 0. Too many ‘sensors’?

IDK. What does the Arduino actually expect?

You probably need to remove the sensor. before the template.
Not sure what it does but it will send a string value. Not sure the receiver likes that

Very straightforward, e.g.

url: http://192.168.178.134/accu=25

results in ‘25%’ on the matrix.

Yeah… so the sensor. shouldn’t be there

1 Like

Solved with:

 url: "http://192.168.178.134/accu={{ states.sensor.solaredge_i1_b1_state_of_energy }}"

This provides the proper sensor value