I just completed a small project with tasmota and OH3 and I wanted to share it here. It is working Ok right now, but I need some advice to make it more user friendly.
The BlissLights Sky Lite laser star projector is a very cool ambient lighting device. It projects a moving image of stars and/or nebulas in the room ceiling. It is designed to be always plugged into a USB power brick, to be turned on using a push button, and it doesn’t remember it’s last state. It is therefore not HA friendly, and cannot be automated simply by plugging it into a smart plug.
I decided to mod it this way:
- Hardware. This part involves soldering 6 cables to the back of the main PCB. Two cables come from the push button opposite terminals (to bypass it), and 2 sets of 5V / GND power one Arduino Keyes Relay (3.3V compatible) and the Wemos D1 mini that controls it using a GPIO output. In the picture both the relay and the Wemos can be seen, hot glued to the case.
Device firmware. I flashed Tasmota to the Wemos, configured the relay GPIO, Wifi and MQTT. This is documented in plenty of blogs.
OH3 configuration. I used a tutorial that was posted here a couple of days ago, that explains how to create Things and items to integrate a device through MQTT using the new UI.
It works nicely for now (I can control the projector both with the physical button and through an Openhab switch), but I have an usability nuisance, and I need some advice:
The physical button as it is toggles between several scenes (OFF—ALL ON - ONLY STARS ON - ONLY NEBULA ON - OFF). To simulate a single scene change with a relay, I must toggle the Openhab switch TWICE (switch/relay ON + switch/relay OFF). The relay effectively ‘clicks’ twice as a consequence, but the device doesn’t react to the OFF transition.
For now, I have created a rule that toggles the switch on and then off, after a delay. And I start this rule when a Phillips hue switch button is double clicked. This works.
But I wonder if there’s a better way to simulate that behaviour (thinking of creating a single channel that sends two MQTT commands with a short delay in between). Note that I’m not concerned about keeping the scene state in OH3, since the device can be operated manually anyway to change scenes.
I would appreciate some pointer to the best way to do that under OH3.