Hi Steve. Thank you so much for the examples. I had tried something similar but couldnt get the format quite right. Really appreciate the help.
Hi @Midgey just a note, the Energenie hardware is controlled via 433Mhz and can be controlled via the new RFLink component directly, without the MiHome hub.
I have emailed RFLink gateway team to have the wall switch added to their supported hardware. The basic plug in sockets are already supported. They are recognized as āEurodomestā sockets.
Thank you for the info!
Many thanks to @stevenhorner ; I was finally able to get my Mi|Home switches working thanks to his example.
does anyone have multiple single switches setup from energenieā¦ i can get them to work, but when i set any automation to switch one off they all turn offā¦ help would be appreciatedā¦
Iām surprised that still no-one seems to have made a component to use Energenie via the web API, since it seems to be quite a popular platform. So I thought Iād have a go myself!
Itās still very much work in (slow) progress, but Iāve got some basic functionality, so I thought Iād share, and see if anyone wants to try it out or help to get it working sooner. Currently it works with non-monitor switches, and Iām working on a sensor platform.
A library to call the API via python can be found here:
and my HA fork is here: https://github.com/ng110/home-assistant
Enjoy.
Iāve got several Mi|Home plugs around the house and also sockets, so whilst in principal Iām happy to help testing they are a key component to my working setup and I wouldnāt want to lose that! Is is easy to swap between testing components and live working components?
How can i use this in my own installation?
Currently have the on/off working but would be great to get the toggle working correctly. (cannot get the state to correctly show as is).
Many thanks
There are lots of things not working yet. Itās work-in-progress as mentioned (and Iām not getting much time to work on it). But if you have the on/off working, it sounds youāve already got it set up okay? Note that the non-monitor Energenie switches do not report back their state, so the state is assumed, and will never be 100% reliable (especially since Energenie switches sometimes fail to switch when requested, or switch off when not requested).
Cheers, N.
I could not figure out how to set up your python script so currently just have command line switch calling the API by ID.
I have set binary sensors to check state using api (these work) but would like the switches to correctly check status also and then show the toggle in front end instead of separate buttons.
(These are the blue sockets and a light switch connected via Mi|Home gateway)
Hi Steve
I donāt suppose you could share the setup could you for the command line sensor as I am struggling with this to get data back from ETRV valves
Thanks in advance
Paul
Hello,
I donāt have any of their TRVs, have looked at them for ages but not sure how well they would fit with my setup. What have you tried so far, the format for the Command Line Sensor I used was further up in the thread but copied below:
sensor:
platform: command_line
command: 'curl -u "<YOURUSERNAME>:<YOURPASSWORD>" -X POST -H "Content-Type: application/json" -d "{\"id\":12345}" https://mihome4u.co.uk/api/v1/subdevices/show'
name: Washer
unit_of_measurement: w
value_template: '{{ value_json.data.last_data_instant }}'
I havenāt changed it since I posted it but it still works. I will help if I can.
Hi Steve
Thanks for your quick response and your posting as it was mot helpful
I had the commands for the light switches and I used your config to do the same with the ertvās
Just setting up the data as we speak on HA
Many thanks again
Paul
Hi Steve
All working good so far
However if I wanted to set the Target Temperature via an Automation would you be able to tell me or guide me how to set this
The APi Says
/api/v1/subdevices/set_target_temperature
Paul
I canāt test this, none of my devices accept 2 parameters. I think this would be the curl command:
curl -u "<YOURUSERNAME>:<YOURPASSWORD>" -X POST -H "Content-Type: application/json" -d "{\"id\":54321, \"temperature\":25.0}" https://mihome4u.co.uk/api/v1/subdevices/set_target_temperature
If I have that correct it would set the device with id 54321 to 25.0 degrees. It looks slightly more complicated because of the escape character \ when quotes are needed.
It maybe that the Rest component would be easier to use than the command line, donāt think that was available when I first did this.
Thanks Steve
Will test this tomorrow
Paul
Thanks for your help
HiSteve
Happy new year to you
The code worked
just have to change the temperature part of the code to a slider or selection text now
Once again thanks for your help
Paul
Hi,
Iām new to Home assistant and the Pi for that matter, in laymanās terms, could you explain how I add your mqtt client to Home Assistant so I can control my energenie light switches etc?
Cheers,
Lance.
Does this require a pimote?
It isnāt really a laymanās tool, but in summary
- You need to buy the two way pi-mote and a rasperry pi 1. A pi 3 or 3+ may work, but I havenāt tried it. I suspect it would require some modification, at least to the included header files.
- You need to download, compile and run my client
- You need to install an MQTT broker ( although I suppose the embedded broker would work, at least to start).
- You need to configure switches in HA with the appropriate MQTT commands.
There is nothing complex if you know have some experience with software development, but I think it would be difficult without some background knowledge.