Is there a way to publish the state of the Power Supply Component to a MQTT topic? I´m wokring on a dimmerpack wich is also probing the Power Input of the external Powersuply, to check if the External Powersuply is realy suplying power when switched on.
I also tried on_press / on_release , however the editor gives me an error that [on_state] is an invalid option for [0]. Sadly the Power Suply Component documentation also doesnt give much information.
Im kinda confused, if i should use the Home Assistant automation UI i need to set that up inside HA then, but i can´t see the state of the Power Suply Component submittet neither thru the native API nor thru mqtt. How can i check the state of the Power Suply Component fom there?
Create an automation so that whenever the power supply status changes, it publishes it to MQTT. Or you could just use the native api with this component:
I tried several attemps for an automation now, the problem is i can´t figure out how to read the state from the Power Suply Component. If i look in the esphome wiki for automations somehow i need to treat the PSC as a binary sensor when reading the state but whatever i tried the Editor will tell me it is not supported for “power_supply” or when trying within a lambda the compiler will exit with an error like this:
src/main.cpp:942:20: error: 'class esphome::power_supply::PowerSupply' has no member named 'state'
Wich makes sense as the PSC is its own class and not listed under binary sensors. Is it possible that there is no way to read the state of the Power supply?
I had a close look agian inside the HA entities i can find all my binary sensors, sensors, text sensors and light components but i can´t find a entity for the Power Suply Component.
Oh, oh, oh. How confused I was. I thought you wanted to export the Home Assistant Raspberry Pi power supply component into ESPHome.
You should use the switch.output component for this.
I already tried the generic switch output component, that way i can manually control the output, but the state of the generic switch is not updated if the PSU output is switched on by the Power Supply Component.
I will put a feature request on the ESPhome github page.
@KTibow Thanks a lot for your patience. Happy new year to you!