RESTful Switch not showing

Hi,

I am trying to controller my Ventilation unit. I got a working curl command that can set ventilation value 3 (max ventilation) and back to 1 (normal ventilation.

a want to make a button to switch in on (to max) and off (to normal). Later i want to user the button with automation bassed on RH in my bathroom. I cant seem to get it to work.

From the commandline I can test the CURL and it works:

curl for max ventilation
curl -X PUT http://IP_ADDRESS/commands.json -H “Content-Type: application/json” -d ‘{“UID0”: 3}’

cur for normal ventilation:
curl -X PUT http://IP_ADDRESS/commands.json -H “Content-Type: application/json” -d ‘{“UID0”: 1}’

What is the sollution?

and

The restful switch can only use POST not PUT for control. Can you use that method instead?

No it needs to be a PUT.

I have no succesfuly created 2 Restfull Commands. How do i get them attached to a button? It would be great to gent an ventilation button

Then Florian’s suggestion is the way.

Use your two restful commands in a template switch.

Do you have a way of getting the state of the switch?

Yes i have, that is the second part of my question. I can do a
curl -X POST http://IP_ADDRESS/actuals.json

And gat a whole list of values, including the state of the ventilation.
Normal gives
“UID1”: “2,0”,
Max gives:
“UID1”: “8,0”,

And a whole bunch of other values (temperature and m3 ventulation speed… What can o do with them values?

Sounds like you should be making a template cover not a template switch.

I got the switch working. It could be more facy with state reading from the actual device. But maybe out of my leage.

Can I get the vallues returned by the curl -X POST http://IP_ADDRESS/actuals.json action into sensors? And also i need to “translate” some values

I get this info:
curl -X POST http://IP_ADDRESS/actuals.json

{
“UID0”: “83,2,1,16,0,2”,
“UID1”: “2,0”,
“UID2”: “153,3”,
“UID3”: “199,3”,
“UID4”: “63,0”,
“UID5”: “1,0”,
“UID6”: “63,0”,
“UID7”: “0,0”,
“UID8”: “100,0”,
“UID9”: “96,0”,
}

How can i get the UID valaes in to sensors?

This way you can create multiple sensors for your endpoint:

You can “translate” your values using templating:

Be sure to read the chapter on how to process incoming data.

Since it seems you are controlling a fan, you can also put everything into one entity for easier control: