Add an OTA password, enable safe mode and Captive Portal When the OTA update finishes, you could then turn the switch on and off, and the LED would also turn on and off depending on the state of the relay. Lastly, click on Upload to compile the firmware and upload it automatically to the Sonoff switch. The binary_sensor, under on_press, change the id name for the switch.toogle from relay to relayandled, which is the ID name that we set up for the template switch on this example.Ĭlick on Save then Close and to check that the configuration is ok, click on Validate. The other switch is a template that would turn on and off both the relay and the led at the same time. A GPIO switch that uses GPIO12 which controls the relay. Then, we added a light component linked to the output that controls GPIO13. We set up an output that uses the GPIO13, which is the PIN that the Sonoff switch uses for the LED. Go to the ESPHome Dashboard and open the Sonoff switch config file and replace the current switch and status_led with the following: So, turning the switch on would also turn on the LED and then off when turning the switch off. For example, let’s make a change to the current firmware, Let’s say we want the green LED on the Sonoff switch to either be on or off depending on the state of the relay. To make updates to the firmware, you can edit the config file in the ESPHome Dashboard and then do an OTA update without having to connect the Sonoff switch to the computer. Click on it, and the options configured under the ESPHome config file would now show up as available entities to use with Home Assistant. Lastly, click on Submit, and you should now have the Sonoff switch integrated. Alternatively, if you set up a static IP address for the Sonoff switch, you can also enter the assigned IP address for that device. Look for the ESPHome integration and click on Configure. If the device was not discovered automatically, you could manually add it. At the top, you should have the new ESPHome device discovered. So, in Home Assistant, go to Configuration and then, Integrations. To use the Sonoff switch with Home Assistant, you would need to integrate it. You would also need a USB to TTL Converter (Transistor-Transistor Logic) and 4 male to female pin wires. To flash the firmware to the Sonoff Basic switch, you can use the ESPHome Flasher, which makes it simple to flash the firmware from a Windows or Mac computer. When the process finishes, click on Download Binary. Once it’s validated, click on the More Options icon on the right, and then Compile. When finished editing the config file, click on Save and then Validate to check that the configuration is correct. version text_sensor: Provides information of the current version of the ESPHome firmware installed on the device.uptime sensor: Tracks the time (in seconds) the device has been online.wifi_signal sensor: Monitors the received signal strength. Letting you know of any warning or errors
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |