Hi everyone, I’m a newcomer to the world of smart home automation and I’m currently diving into integrating my myStrom Switch into my OpenHAB setup. The journey has been both exciting and a bit challenging, but I’m determined to figure it out!
My goal is to control the switch offline via OpenHAB and also detect if someone manually presses the button on the device. I’ve managed to get the switch control working using simple HTTP GET commands, which is great. However, I’m stuck on integrating the switch state into my OpenHAB switch item. The device provides a JSON file with the state, but I need to transform the ‘true’ and ‘false’ values into ‘ON’ and ‘OFF’ for OpenHAB to recognize them properly.
I’ve tried using MQTT bindings before, where you can transform the content by adding ‘ON:1’ or ‘OFF:1’ at the end, but this approach doesn’t seem to work here. I attempted modifying the HTTP binding with something like <[http://IP/report:1000:JSONPATH($.relay):OFF:false], but it didn’t solve the issue. I’m wondering if there’s a different transformation method or binding I should be using instead.
I’d love to hear from anyone who has successfully integrated a similar setup or has insights into how to handle JSON state transformations in OpenHAB. Any tips or suggestions would be greatly appreciated!
Cheers,
[Your Name]