Rkg90
(Rasmus Grevy)
1
Hi
Om new with home assistant.
I have a “control panel” with button that i want to Control my rpi.
I Can read the serial data with ssh and send commands back to the control panel.
But how do i make home assistant read the serial gate? And then toggle a switch ?
Hope someone Can help me
fabaff
(Fabian Affolter)
2
There is a serial
sensor. You could try to read the state and control your device with a command_line
switch.
Rkg90
(Rasmus Grevy)
3
Thanks for your reply.
Can you try to give a basic example ?
Like
If serial = “switch1”
{
toogle switch1
}
if serial = “switch2”
{
toogle switch2
}
fabaff
(Fabian Affolter)
4
Hard to do that without knowing the details. After you have setup your sensor and your switch check
Rkg90
(Rasmus Grevy)
5
So i have this in my configuration.yaml now:
automation:
trigger:
platform: template
value_template: "{% if is_state('sensor.serial_sensor', 'poweron') %}true{% endif %}"
action:
service: switch.toggle
entity_id: switch.r4
i have the control panel send “poweron” over serial. i can verify this with
sudo minicom -D /dev/ttyAMA0
over ssh.
But the automation is not triggered. i can manually trigger the automation and the relay (R4) is toggled.
So what have i done wrong ? 
Rkg90
(Rasmus Grevy)
6
Is there really No one who can help me with this ?
fabaff
(Fabian Affolter)
7
If you can control the switch via the frontend then is your automation rule wrong.