The switch can store two different codes, so you can use two different remotes to control it. You can make up codes for use from the PiMote, but there are rules that have to be met in the signal. I think I found out what they were when I was writing engMQTTclient, but I have long since forgotten. I may have them written down in the documentation. I listen for the remote code and just use that.
I use OpenMQTTGateway to listen for signals, but any 433Mhz snooper should do the job.
Not directly, but if you configure a switch to send the code, it will be sent . when you turn the switch on.
I canāt help there, I live in a rural market town. But the signal strength is attenuated by walls, and there are plenty of codes, so I donāt think it would be a problem.
Yes, and I was surprised it worked. I just copied the code the the remote sent and used it in the MQTT message, but there is no guarantee it will work for anything else. There are different protocols used by different manufacturers, and not all of them are compatible.
Hi Steve you seem to be the go to man on the home assistant, energenie, command line subject and wondered if you could cast any light on my problem?
I have an energenie thermostat which i can switch on and off in home assistant with the code below
As you can see i have hashed out the command_state and value_template as these are not returning the state of the relay and make the switch return to off after it is switched on.
Any help appreciated
Apologies for not replying I havenāt done much with Energenie for a long time. Iām guessing you are trying to do a switch that turns on and off your thermostat which is the part that is uncommented.
I think the part that is commented should actually be a sensor not a switch.
Thanks for the response steve i had got a sensor setup already but it didnt work with the command_line switch, but it does work with the template switch with the following
Iāve been using the HTTP POST commands as posted by StevenHorner further up this thread (thanks!). However Iāve noticed that the switch on/off commands are no longer working in ny HA setup. I can still turn them off from the Energenie web console, and have re-checked my device IDās against the Energenie console, but my Home Assistant commands are no longer triggering the switches.
Hereās an example of one of my commands (with idās substituted):
Is it possible to get the current state of energenie switches such that the HA UI shows the correct state?
Iām pretty new to this but using the mihome api and the curl command as described above I have my light and plug switches working in that I can turn them on/off. (So thanks for the info) But, if the switch is triggered by something else, say I actually press the physical button, the HA UI becomes out of sync - even when refreshed. I know there is a api to get current state, but is it possible to integrate this into HA Ui some how?
Thanks
Thank you!
I accidentally bought one of these thinking it was tuya-based, and at least I can control it for the few weeks I need it and then can send it back when I can access my already tasmotised plugs.
I was using a APIRequest.io to get the details but it kept responding ānot foundā when controlling devices, but your command just worked as soon as I put in the details.
Sorry for the delay, I have not completed the full switch yet (will post once complete), but here is the code to get power measurement from the MiHome Smart Plug MIHO005 and MIHO004 and add them to the āEnergyā page of home assistant. Using ārestā and āintegrationā platforms.
The platform: integration will show up in ā/developer-tools/statisticsā and can be added via ā/config/energyā
Set username, password and payload ID (for your switch/sensor) as appropriate.
########################################################################
# MiHome Living Room TV Switch
########################################################################
# Control and Monitor.
# Mi|Home Smart Plug+ MIHO005
- platform: rest
name: "MiHome Living Room TV Switch Watts"
resource: 'https://mihome4u.co.uk/api/v1/subdevices/show'
method: POST
authentication: basic
username: !secret MiHome_ID
password: !secret MiHome_Password
payload: '{"id":311088}'
value_template: '{{ value_json.data.real_power }}'
unit_of_measurement: W
device_class: power #Power, watts. Not "Energy" i.e. Wh.
state_class: measurement
json_attributes_path: "data"
json_attributes:
- label
- device_id
- power_state
- startup_mode
- device_type
- remote_id
- voltage
- voltage_reported_at
- frequency
- real_power
- today_wh
headers:
Content-Type: application/json
force_update: true
# https://www.home-assistant.io/integrations/integration/
# https://community.home-assistant.io/t/powercalc-virtual-power-sensors/318515/3
# https://www.home-assistant.io/integrations/integration/#energy
- platform: integration
source: sensor.mihome_living_room_tv_switch_watts
name: MiHome Living Room TV Switch Energy
unit_prefix: k
unit_time: h
round: 2
unit: kWh
########################################################################
# MiHome Server Plug
########################################################################
# https://mihome4u.co.uk/devices/37815/subdevices/279158/edit
# Monitor only, has no control.
# Mi|Home Smart Monitor Plug MIHO004
- platform: rest
name: "MiHome Server Monitor Plug Watts"
resource: 'https://mihome4u.co.uk/api/v1/subdevices/show'
method: POST
authentication: basic
username: !secret MiHome_ID
password: !secret MiHome_Password
payload: '{"id":279158}'
value_template: '{{ value_json.data.real_power }}'
unit_of_measurement: W
device_class: power #Power, watts. Not "Energy" i.e. Wh.
state_class: measurement
json_attributes_path: "data"
json_attributes:
- label
- device_id
- power_state
- startup_mode
- device_type
- remote_id
- voltage
- voltage_reported_at
- frequency
- real_power
- today_wh
headers:
Content-Type: application/json
force_update: true
# https://www.home-assistant.io/integrations/integration/
# https://community.home-assistant.io/t/powercalc-virtual-power-sensors/318515/3
# https://www.home-assistant.io/integrations/integration/#energy
- platform: integration
source: sensor.mihome_server_monitor_plug_watts
name: MiHome Sever Monitor Plug Energy
unit_prefix: k
unit_time: h
round: 2
unit: kWh
Hi All very new to home assistant i have about 8eTRV and verious light switchs and sockets and they all connect the Energnie hub and for many years have work great. to start with all i want is to be simple be able to record the temperature in home assistant but i cant find a simple solution to follow. I am also using an old pc to power Home assistant.