Energenie MiHome component


#41

Mind blown already! :open_mouth:


#42

Hi Lance
I have three energie single pole switches so far and an ERTV valve

First think I did was download the mi home app and start to power them on and off with the remote or from the web

that will vive you a basic idea of how they work especially if you look at the URL and the device ID’s

Second read this full thread Especially the posts from stevehorner as they are 100% spot on

writing them into your config file will make the switch work

Paul


#43

@paullayton Please you got it working. How are you finding the eTRVs, I have been considering them for more than a year but not really sure what I would gain in conjunction with my Nest.

Something for anyone else reading this thread who is thinking of using their light switches, they do work but if you only have one you will need dimmable bulbs if using LEDs otherwise the bulbs will flicker constantly. I removed one of my 2 light switches when renovating the kitchen which then caused the non dimmable bulb in our bedroom to flicker not the best light to have this happen to when trying to sleep. Switched to dimmable LED bulbs and not a problem anymore, this is stated now when you buy them but wasn’t when I got mine. The biggest issue with the light switches and the sockets is not knowing it’s current state, they can easily get out of sync if someone turns it on in Home Assistant but off at the wall. The monitoring socket does report it’s status which could update Home Assistant.


#44

Hi Steve

I only have 1 ETRV in the Bedroom, and it does work well, but I don’t have Hive or anything else set up yet, so the vales are turned up or down at the moment with Alexa

In regards to the LED Bulbs, I have the same problem, I installed miniature LED Spot Lights in the stair Risers that are controlled by MI, and they do flicker when switched off, I don’t have the same problem with normal bulbs, but as you said they tend to lose sync with home assistant especially if you turn them on at the switch. the APP reports correctly but HA doesn’t always report back the true state

The switches in my opinion are good, as is the ETRV but still looking at a system, or a means that will report states back, Unless I can use the API to report back on a regular basis through automation to get the correct state

One again Steve thanks for your help

p.s Still struggling to put the temperature in the example you gave me and change it to use a slider.state :smile:

Paul


#45

I managed to get my MiHome light switches working using the command line script that Steve posted.

But would still like to be able to control my energenie stuff locally without the need of an internet connection!

Thanks for posting Steve, most helpful!


#46

I had issues with the energenie hub stopping working for no reason. Even their tech support couldn’t find the problem.

I was using an arduino mega with 433mhz transceiver and rflink firmware for over a year with no issues.

I’ve recently changed to an esp8266 and openmqttgateway. This has been working fine the rflink option is the simplest.


#47

I ran the update of hassio to 0.86.3 this morning and now my light switches appear to have no entities! :frowning:

I shall have to look and see what has changed!


#48

Ok, this evening I rolled back my install using a snapshot I did of my install at version 0.85.1 and all was well, I then updated it to 0.86.3 and it’s still working properly!


#49

Hey All, really interested in this topic. I’ve been looking at the Energenie TRV’s and thinking of using the Sonoff RF Bridge in order to read the signals and send commands. Has anyone had any luck in integrating these using only the TRV & a Sonoff RF Bridge?

If so, could you also post an example of the packet that the devices send?


#50

I am fairly sure this will not work. The eTRVs use FSK encoding which I am pretty sure is not supported by the Sonoff RF Bridge.


#51

I use a Mihome ERTV and I can read the values as per the recommendations in this thread

I have the current temperature and the voltage of the valve recorded, and don’t use the sonoff bridge


#52

You get the values from the energenie web api?


#53

Yes

Code below

I havnt worked out yet how to add a slider to change the temperature

Credits stevehorner above for the code

sensor:

  - platform: command_line
    command: 'curl -u "email:password" -X POST -H "Content-Type: application/json" -d "{\"id\":146015}" https://mihome4u.co.uk/api/v1/subdevices/show'
    name: mbs_radiator
    unit_of_measurement: °C
    value_template: '{{ value_json.data.last_temperature }}'

  - platform: command_line
    command: 'curl -u "email:password" -X POST -H "Content-Type: application/json" -d "{\"id\":146015}" https://mihome4u.co.uk/api/v1/subdevices/show'
    name: mbs_targettemp
    unit_of_measurement: °C
    value_template: '{{ value_json.data.target_temperature }}'

  - platform: command_line
    command: 'curl -u "email:password" -X POST -H "Content-Type: application/json" -d "{\"id\":146015}" https://mihome4u.co.uk/api/v1/subdevices/show'
    name: mbs_voltage
    unit_of_measurement: v
    value_template: '{{ value_json.data.voltage }}'

#54

This Code Steve gave me to set the target temperature to 25c

I have been trying to learn yaml and put the code in for a slider but cant seem to get the hang of it
the code in a sensor does change the target temp

once again credit stevehorner

curl -u "YOURUSERNAME;:YOURPASSWORD" -X POST -H "Content-Type: application/json" -d "{\"id\":146015, \"temperature\":25.0}" https://mihome4u.co.uk/api/v1/subdevices/set_target_temperature

if you or Stevehorner (hint hint) can help with this part so I can see what I am doing wrong I would be most grateful


#55

Thanks gpbento, that helps me a lot. Would you say that the Pi-Mote is a good way to go instead of RF Bridge or Mi Home Gateway? Im looking for local control which doesn’t need too much maintenance once its set up.

I took look at your code and it looks really good - posted a few years ago now, so I assume its fairly stable? Could it be ran on the same Pi as HASS.io? or does it need a separate one? Would it work on a Pi Zero?

Sorry for all the questions :smiley:


#56

The Pi-Mote is a good way to go if you have a reasonable knowledge of c code. It is not really for the beginner. There is an alternative approach in Python on github here, but I don’t think it is quite stable yet.

I don’t know of any generic RFBridge that uses the same protocol as the energenie eTRVs. The sockets and plugs and light switches all work, but
they use a more common protocol.

I have never used the Mi Home Gateway, but I understand you have to connect it to the internet, so it is not acceptable for me.

It runs all the time on my Pi, and I haven’t felt the need to tweak it for a couple of years.

I don’t think so. I understand you need to write an addon for that, and I have had no interest in doing so. I currently run homeassistant in a venv on the same Pi.

I have also only ever run the code on a Pi 1 B+. I think it would need to link with different libraries to run on a Pi 2 or 3… I’m not sure about the zero, I can’t remember exactly what the processor is, but it should be possible to do.


#57

Wonder if anyone can help me out, I have a number of Energenie Mi|Home switches and sockets and though I have managed to use the API to send the on/off commands I am struggling to get the current state … below is an example of my code;

Energenie Mi|Home Integration

switch:

Now the on/off works … but I get the following error in the logs for getting the current state;

2019-02-11 09:26:50 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.data.power_state == 1 }})

Anyone able to shed some light on this ?