Looking for help with my gates sensor. I have PLC (Wago 750) connected to HA by Modbus TCP. I have a few inputs connected which have few states from a single sensor (Modbus_sensor): 252 (gates opened), 253 (gates closed), 254 (gates malfunction), 255 (gates in progress). Those statuses i’m able to read in sensor.gates. If I put code into http://localhost:8123/developer-tools/template, then statuses will be displayed as well correctly (Opened, closed and etc):
Thanks for answer. If I put same code without quotes into yaml then nothing changed - failed (else).
If I put code without quotes into Template section I’l get failed (else) response.
You need to combine both sensor platforms under one sensor: or append a string or number to the end of one of the sensor: keys. See here for more info.
Personally, I think the first option makes more sense in most cases.