Energenie MiHome component


#21

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.


#22

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.


#23

Thank you for the info!


#24

Many thanks to @stevenhorner ; I was finally able to get my Mi|Home switches working thanks to his example.


#25

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…


#26

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.


#27

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?


#28

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


#29

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.


#30

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)


#31

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


#32

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.


#33

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


#34

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


#35

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.


#36

Thanks Steve

Will test this tomorrow

Paul

Thanks for your help


#37

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


#38

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.


#39

Does this require a pimote?


#40

It isn’t really a layman’s tool, but in summary

  1. 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.
  2. You need to download, compile and run my client
  3. You need to install an MQTT broker ( although I suppose the embedded broker would work, at least to start).
  4. 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.


IoT device compatibility