I have followed the guide below to create a rest switch for my TendaBeli plugs. How can I add them to my dashboard as a switch to toggle them on/off?
Thanks
I have followed the guide below to create a rest switch for my TendaBeli plugs. How can I add them to my dashboard as a switch to toggle them on/off?
Thanks
The switch itself is added by default to the new automatic dashboard in HA if you created it in yaml. You can also assign it an area in said configuration.yaml so that it will appear inside its designated area in the UI
The switch hasnt been added to the dashboard. The switch was working when I was triggering it via a motion sensor. How do i set the area for the device?
Here is my code in the configuration.yaml
switch:
- platform: rest
name: TendaSP6-1
resource: http://192.168.x.x:5000/setSta
state_resource: http://192.168.x.x:5000/getSta
is_on_template: "{{ value_json.data.status == 1 }}"
body_on: '{"status":1}'
body_off: '{"status":0}'
headers:
Content-Type: application/json
Sorry what I meant to say was: if you give it a unique_id: tendasp6_1
in the yaml, it will then let you assign an area within the UI and then it will add it automatically within that area in the dashboard. But even without the unique id it should have added it to the dash in the section of switches that are without any areas assigned.
Can you action the switch via HA?
Its IP had changed so it wasnt working inside HA, Doh. Its all good now, thanks for the pointers and advice.