Had a look in the code for geohome custom component in github and I can see:
update_interval=timedelta(seconds=120),
So looks like the data from geohome is updating at max every 2 mins.
Had a look in the code for geohome custom component in github and I can see:
update_interval=timedelta(seconds=120),
So looks like the data from geohome is updating at max every 2 mins.
I had the same issue and contacted Geo support in the end.
You need to email [email protected], explain that you bought WIFI module separately and send them a picture of the device info (under Setting in Trio), they need to allow your Trio to connect to their Cloud.
Hi everone who has been having issues. Sorry - I was not getting any notifications about the posts here so was oblivious to it all. I’ll take a look through the issues list and see what I can do.
Martin
If you are getting an error while trying to get your username, make sure you are running the code in the HA terminal, rather than your Windows command prompt.
Also useful to remember shift + highlight to copy from the HA terminal.
FYI, the integration is now available via HACS, with fixes from various contributors (thanks all!). I am waiting for it to be added to the HACS default repositories, but for now you can add it as a custom repository at https://github.com/mmillmor/geo_home
This will fix the pound sign for you, and stop a few potential errors.
Most people seem to trip up on needing to ask customer service to enable their account for api access, so don’t forget to email e-mail [email protected] to ask them to enable your meter.
Great news this will be on HACS
I found that there is another URL that you can pull to get more info about standing charge pricing etc which is “smets2-daily-data”.
I had a bit of a play with the original code posted here https://community.home-assistant.io/t/uk-smart-energy-meters/16545/205 around access tokens etc and set the units for a bunch of sensors as well as availability markers etc.
I have a geo_together_sensor.yaml that now looks like this:
#
# Renew Access Token
#
- platform: rest
name: "Geo API Access Token"
method: POST
payload: '{ "identity" : "[id]", "password": "[password]" }'
resource: https://api.geotogether.com/usersservice/v2/login
scan_interval: 3555
value_template: >
{% if value_json.accessToken is defined %}
{{ "on" }}
{% else %}
{{ "unavailable" }}
{% endif %}
json_attributes:
- accessToken
#
# Get System ID
#
- platform: command_line
command: >
curl
-H "Authorization: Bearer {{ state_attr('sensor.geo_api_access_token', 'accessToken') }}"
-H "Accept: application/json"
-H "Content-Type: application/json"
'https://api.geotogether.com/api/userapi/v2/user/detail-systems'
name: Geo API Details
unique_id: geo_api_details
scan_interval: 3555
value_template: >
{% if value_json.systemRoles is defined %}
{{ "on" }}
{% else %}
{{ "unavailable" }}
{% endif %}
json_attributes:
- systemRoles
#
# Pull Datasets
#
- platform: command_line
command: >
curl
-H "Authorization: Bearer {{ state_attr('sensor.geo_api_access_token', 'accessToken') }}"
-H "Accept: application/json"
-H "Content-Type: application/json"
'https://api.geotogether.com/api/userapi/system/smets2-live-data/{% if states.sensor.geo_system_id.state is defined %}{{ states.sensor.geo_system_id.state }}{% else %}{% endif %}'
name: Geo API Live Data
unique_id: geo_api_live
scan_interval: 60
value_template: >
{% if value_json.power is defined %}
{{ "on" }}
{% else %}
{{ "unavailable" }}
{% endif %}
json_attributes:
- latestUtc
- power
- systemStatus
- platform: command_line
command: >
curl
-H "Authorization: Bearer {{ state_attr('sensor.geo_api_access_token', 'accessToken') }}"
-H "Accept: application/json"
-H "Content-Type: application/json"
'https://api.geotogether.com/api/userapi/system/smets2-periodic-data/{% if states.sensor.geo_system_id.state is defined %}{{ states.sensor.geo_system_id.state }}{% else %}{% endif %}'
name: Geo API Periodic Data
unique_id: geo_api_periodic
scan_interval: 600
value_template: >
{% if value_json.totalConsumptionList is defined %}
{{ "on" }}
{% else %}
{{ "unavailable" }}
{% endif %}
json_attributes:
- latestUtc
- totalConsumptionList
- billToDateList
- activeTariffList
- currentCostsElec
- currentCostsGas
- platform: command_line
command: >
curl
-H "Authorization: Bearer {{ state_attr('sensor.geo_api_access_token', 'accessToken') }}"
-H "Accept: application/json"
-H "Content-Type: application/json"
'https://api.geotogether.com/api/userapi/system/smets2-daily-data/{% if states.sensor.geo_system_id.state is defined %}{{ states.sensor.geo_system_id.state }}{% else %}{% endif %}'
name: Geo API Daily Data
unique_id: geo_api_daily
scan_interval: 3555
value_template: >
{% if value_json.standingChargeList is defined %}
{{ "on" }}
{% else %}
{{ "unavailable" }}
{% endif %}
json_attributes:
- latestUtc
- standingChargeList
Then I have a geo_together_template.yaml file that looks like this:
- sensor:
#
# Detail Sensors - System ID
#
- unique_id: geo_system_id
name: 'Geo System ID'
state: >
{{
state_attr('sensor.geo_api_details','systemRoles') |
map(attribute='systemId') |
first
}}
availability: >
{{ states.sensor.geo_api_details.state }}
#
# Daily Sensors - Standing Charge
#
- unique_id: geo_electricity_standing_charge
name: 'Geo Electricity Standing Charge'
state: >
{{
(
state_attr('sensor.geo_api_daily_data','standingChargeList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='standingCharge') |
first /100
) |
round(5)
}}
availability: >
{{
states.sensor.geo_api_daily_data.state and
(
state_attr('sensor.geo_api_daily_data','standingChargeList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_gas_standing_charge
name: 'Geo Gas Standing Charge'
state: >
{{
(
state_attr('sensor.geo_api_daily_data','standingChargeList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='standingCharge') |
first /100
) |
round(5)
}}
availability: >
{{
states.sensor.geo_api_daily_data.state and
(
state_attr('sensor.geo_api_daily_data','standingChargeList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
#
# Periodic Sensors - Total Usage
#
- unique_id: geo_gas_total_consumption_m3
name: 'Geo Gas Total Consumption m³'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='totalConsumption') |
first/1000
) |
round(3)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
unit_of_measurement: "m³"
device_class: gas
state_class: total_increasing
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
- unique_id: geo_gas_total_consumption_kwh
name: 'Geo Gas Total Consumption kWh'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='totalConsumption') |
first/1000*1.02264*39.2/3.6
) |
round(3)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
- unique_id: geo_electricity_total_consumption_kwh
name: 'Geo Electricity Total Consumption kWh'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='totalConsumption') |
first
) |
round(3)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','totalConsumptionList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='valueAvailable') |
first
) == true
}}
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
#
# Periodic Sensors - Bill to Date
#
- unique_id: geo_electricity_bill_to_date
name: 'Geo Electricity Bill To Date'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','billToDateList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='billToDate') |
first /100
) |
round(2)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','billToDateList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_gas_bill_to_date
name: 'Geo Gas Bill To Date'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','billToDateList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='billToDate') |
first /100
) |
round(2)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','billToDateList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
#
# Periodic Sensors - Tarrif
#
- unique_id: geo_electricity_current_unit_price
name: 'Geo Electricity Current Unit Price'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','activeTariffList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='activeTariffPrice') |
first /100
) |
round(5)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','activeTariffList') |
selectattr('commodityType', 'equalto', 'ELECTRICITY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_gas_current_unit_price
name: 'Geo Gas Current Unit Price'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','activeTariffList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='activeTariffPrice') |
first /100
) |
round(5)
}}
availability: >
{{
states.sensor.geo_api_periodic_data.state and
(
state_attr('sensor.geo_api_periodic_data','activeTariffList') |
selectattr('commodityType', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: monetary
unit_of_measurement: "GBP"
#
# Periodic Sensors - Electricity Cost History
#
- unique_id: geo_electricity_cost_today
name: 'Geo Electricity Cost Today'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'DAY') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_electricity_cost_this_week
name: 'Geo Electricity Cost This Week'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'WEEK') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_electricity_cost_this_month
name: 'Geo Electricity Cost This Month'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'MONTH') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
#
# Periodic Sensors - Electricity Consumption History
#
- unique_id: geo_electricity_kwh_today
name: 'Geo Electricity kWh Today'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'DAY') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
- unique_id: geo_electricity_kwh_this_week
name: 'Geo Electricity kWh This Week'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'WEEK') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
- unique_id: geo_electricity_kwh_this_month
name: 'Geo Electricity kWh This Month'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsElec') |
selectattr('duration', 'equalto', 'MONTH') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
#
# Periodic Sensors - Gas Cost History
#
- unique_id: geo_gas_cost_today
name: 'Geo Gas Cost Today'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'DAY') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_gas_cost_this_week
name: 'Geo Gas Cost This Week'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'WEEK') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
- unique_id: geo_gas_cost_this_month
name: 'Geo Gas Cost This Month'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'MONTH') |
map(attribute='costAmount') |
first /100
) |
round(2)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: monetary
unit_of_measurement: "GBP"
#
# Periodic Sensors - Gas Consumption History
#
- unique_id: geo_gas_kwh_today
name: 'Geo Gas kWh Today'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'DAY') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
- unique_id: geo_gas_kwh_this_week
name: 'Geo Gas kWh This Week'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'WEEK') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
- unique_id: geo_gas_kwh_this_month
name: 'Geo Gas kWh This Month'
state: >
{{
(
state_attr('sensor.geo_api_periodic_data','currentCostsGas') |
selectattr('duration', 'equalto', 'MONTH') |
map(attribute='energyAmount') |
first
) |
round(3)
}}
availability: >
{{ states.sensor.geo_api_periodic_data.state }}
device_class: energy
unit_of_measurement: "kWh"
#
# Live Sensors - Current Usage
#
- unique_id: geo_electricity_current_usage
name: 'Geo Electricity Current Usage'
state: >
{{
(
state_attr('sensor.geo_api_live_data','power') |
selectattr('type', 'equalto', 'ELECTRICITY') |
map(attribute='watts') |
first
) |
round(0)
}}
availability: >
{{
states.sensor.geo_api_live_data.state and
(
state_attr('sensor.geo_api_live_data','power') |
selectattr('type', 'equalto', 'ELECTRICITY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: energy
unit_of_measurement: "W"
- unique_id: geo_gas_current_usage
name: 'Geo Gas Current Usage'
state: >
{{
(
state_attr('sensor.geo_api_live_data','power') |
selectattr('type', 'equalto', 'GAS_ENERGY') |
map(attribute='watts') |
first /1000
) |
round(3)
}}
availability: >
{{
states.sensor.geo_api_live_data.state and
(
state_attr('sensor.geo_api_live_data','power') |
selectattr('type', 'equalto', 'GAS_ENERGY') |
map(attribute='valueAvailable') |
first
) == true
}}
device_class: gas
unit_of_measurement: "kW"
#
# Live Sensors - System Status
#
- unique_id: geo_system_status_display
name: 'Geo System Status Display'
state: >
{%
set display = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'DISPLAY') |
map(attribute='statusType') |
first)
%}
{%
set display_error_code = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'DISPLAY') |
map(attribute='systemErrorCode') |
first)
%}
{% if display is defined %}
{{ display }} - {{ display_error_code }}
{% else %}
{{ 'ASSUMED_OK' }}
{% endif %}
availability: >
{{ states.sensor.geo_api_live_data.state }}
- unique_id: geo_system_status_zigbee
name: 'Geo System Status Zigbee'
state: >
{%
set zigbee = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'ZIGBEE') |
map(attribute='statusType') |
first)
%}
{%
set zigbee_error_code = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'ZIGBEE') |
map(attribute='systemErrorCode') |
first)
%}
{% if zigbee is defined %}
{{ zigbee }} - {{ zigbee_error_code }}
{% else %}
{{ 'ASSUMED_OK' }}
{% endif %}
availability: >
{{ states.sensor.geo_api_live_data.state }}
- unique_id: geo_system_status_electricity
name: 'Geo System Status Electricity'
state: >
{%
set electricity = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'ELECTRICITY') |
map(attribute='statusType') |
first)
%}
{%
set electricity_error_code = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'ELECTRICITY') |
map(attribute='systemErrorCode') |
first)
%}
{% if electricity is defined %}
{{ electricity }} - {{ electricity_error_code }}
{% else %}
{{ 'ASSUMED_OK' }}
{% endif %}
availability: >
{{ states.sensor.geo_api_live_data.state }}
- unique_id: geo_system_status_gas
name: 'Geo System Status Gas'
state: >
{%
set gas = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'GAS') |
map(attribute='statusType') |
first)
%}
{%
set gas_error_code = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'GAS') |
map(attribute='systemErrorCode') |
first)
%}
{% if gas is defined %}
{{ gas }} - {{ gas_error_code }}
{% else %}
{{ 'ASSUMED_OK' }}
{% endif %}
availability: >
{{ states.sensor.geo_api_live_data.state }}
- unique_id: geo_system_status_wifi
name: 'Geo System Status WiFi'
state: >
{%
set wifi = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'WIFI') |
map(attribute='statusType') |
first)
%}
{%
set wifi_error_code = (state_attr('sensor.geo_api_live_data','systemStatus') |
selectattr('component', 'equalto', 'WIFI') |
map(attribute='systemErrorCode') |
first)
%}
{% if wifi is defined %}
{{ wifi }} - {{ wifi_error_code }}
{% else %}
{{ 'ASSUMED_OK' }}
{% endif %}
availability: >
{{ states.sensor.geo_api_live_data.state }}
The two files are placed in the respective configuration.sensor.enabled and configuration.template.enabled directories and are loaded with the following lines added to configuration.yaml:
sensor: !include_dir_merge_list configuration.sensor.enabled/
template: !include_dir_merge_list configuration.template.enabled/
@mmillmor could you add the sensors etc to your HACS integration?
The above gives me the following Electricity related entities:
Gas related entities:
Geo status entities:
Hi
Could you help me with adding these files to HA. Where do I add them please as I can’t find any
configuration.sensor.enabled and configuration.template.enabled directories
Many Thanks
Thanks for the suggestions @Keyman3. I have updated the integration to add those values.
@miniwilliams, you should use HACS to install the integration - that way you will stay updated with fixes and so on.
A note for everyone who is an existing user - I corrected the way I was recording money to use “GBP” instead of “£”. Your “statistics_meta” table will have the wrong values in it for unit_of_measurement and it. You should edit the database to change the value to GBP using the SQLite Web add-in if you want to preserve historic data
@mmillmor I have just removed my old stuff and updated to your HACS version. Any chance you could add the Gas m3 usage and wifi / zigbee status items too?
@Keyman3, I’ve just added the connectivity information.
The meter doesn’t give m3, so I haven’t added that. The conversion factor isn’t constant - it varies throughout the year, so I don’t want to just hard code a value.
Thanks
I’ll use HACS now and hope for the best
Looks like he integration for gas into the HA energy dashboard still isnt working for me
Has anyone got this working in their config? I know this is a HA bug not the integration
@mmillmor I believe the meter only provides m3 hence the “* 11.3627 / 1000” in line 161 of geohome.py?
Blimey, you are right. I had forgotten ever doing that. I’ll add the original m3 too
Thanks @mmillmor
As @Tommy8884 mentioned, with the code in HACS I can’t get the gas meter reading in kWh to come up as a viable source for the energy dashboard. I have gone back to my code above and that sensor does show up.
I can’t see that many different attributes, I wonder if it is to do with the last_reset date I have set in my template for that sensor?
It’s simply due to a bug introduced when Water was added. See Can't add Gas Consumption with device_class energy · Issue #14292 · home-assistant/frontend · GitHub
The Gas m3 sensor is there now
Thanks @mmillmor
I’ve got the gas showing up in the energy dashboard after a quick manual edit of .storage/energy to flip it over to your sensor name.
He. Can you explain that please. What sensor name did you use and where did you do the edit.
Thanks