Home-Assistant-Configuration
Home-Assistant-Configuration copied to clipboard
Help with Energenie MiHome control
Hi Im trying to get my energine Gateway on to Home Assistant to contol my switches and I’m confused with the code energenie_mihome_gateway.yaml . I have the mac addressand ip address, but what is the defult port of the gateway? Is the label the name of the gateway, or is the user_id the gateway id? What is created_at, updated_at, auth_code, firmware_version_id, and last_seen_at ?
I am note a coder, so is it possible that you can you explan it a bit more in plain english?
Below is what I have managed to update here (XXXXXXXXXX) are included instead of my personal details. `sensor:
- platform: rest # https://www.home-assistant.io/integrations/sensor.rest/
name: "MiHome Gateway Status 1" # Could use a binary rest sensor, but then you could not have attributes.
resource: 'https://mihome4u.co.uk/api/v1/devices/list'
method: POST
authentication: basic
username: !secret XXXXXXXXXX
password: !secret XXXXXXXXXX
payload: '{}' # Leave blank
This sets the state as FALSE, if last_seen_at is more than 240 seconds ago.
value_template: '{{(now() - value_json.data.0.last_seen_at | as_datetime).seconds < 240}}'
value_template: "{{ as_timestamp(now()) - as_timestamp(value_json.data.0.last_seen_at) < 240 }}" json_attributes_path: "$.data.0" json_attributes:- mac_address XXXXXXXXXX
- ip_address 192.168.1.132
- port
- label Home
- user_id XXXXXXXXXX
- created_at
- updated_at
- auth_code
- firmware_version_id 1.5.9 12062018
- last_seen_at headers: Content-Type: application/json force_update: true scan_interval: 60` Kind regards
Tim