Hi all,
I have several years HA on a pi thats communicates with my beckhoff PLC (with ADS) thats controls my home lights en etc.
For now I used the standaard switches and lights. (lovelace didn’t exist on that time)
I bought a nuc and put proxmox on it and also HA.
en now I wanna upgrade some things.
But first some I gonna explane the situation how I work now.
My beckhoff controls everything. so if I a wanna turn on a light it just needs a pulse. But HA doesn’t work like that. what I do is use a switch in HA , when I turn it ON in HA the PLC receives that ON signal use it and put the switch back to OFF.
that worked for me fine.
what i want to achieve is the following:
I wanna see of my light is on or not in reality.
Is het posible to make a button thats uses the switch to turn a light on and off and colors the icon when it is realy on with a binary sensor comming from my bechoff.
I already read a lot but, the more I read the less I see the light
I don’t know were to start, and maybe there is other way thant those switches.
It might be a different command based on with twincat you are using. I am using twincat 2 and I have managed to integrate all the lights and enocean wall switches to my Home Assistant.
This is my code from my light.yaml. If I understand your wishes correctly, you want to see the status of the light but also want to control that also?
In my example light template creates a new entity called light.sauna that can be controlled in Home Assistant.
I just figured out an easier way for this and couldn’t really find any clear examples of this. I used this for my coffee machine.
My switch is: switch.power_button
My sensor is: binary_sensor.power_status
Using the template platform, it combines the switch and sensor so the standard button can get the ‘value’ from the binary sensor through the entity “coffee_machine”
here is my code that goes into configuration.yaml: