homeassistant-infinitude
homeassistant-infinitude copied to clipboard
Feature request: Gas usage
Infinitude expose the gas consumption in a different API http://HOST/energy.json
I think it will be cool to create a sensor and expose that to home assistant
thanks
I've been investigating using this endpoint to access the gas usage and it might be feasible, but I'm not certain. As far as I can tell, the energy.json
file tracks the energy usage for the last 2 days, the last 2 months, and the last 2 years, and is how the stock GUI of the thermostat itself shows energy usage trends. It does not appear to track the current day's usage.
I have a total of 5 zones that I've brought in through Infinitude and this integration. I would love to be able to bring all of my HVAC electricity and gas usage into HA to view on the energy dashboard, etc.
@SionSheevok Have you made any progress on this? I see in the Carrier app where their API seems to track two day, two month, and year to date usage for energy. But, the energy page on Infinitude seems to parse the day 1 data from day 2. Is that what you would need?
@BuggaHouse I didn't want to create a dupe, but do you mind changing the title of this FR to 'Electricity and Gas Usage'?
@GitHubGoody I recommend using a json formatting plugin to more easily spelunk json output, but to answer your question, each set of values in the cost
and usage
structures of energy.json has its own id
property with values day1
/day2
month1/2 year 1/2
also applies to question asked in #48
I've added a pull request that adds a dictionary with energy usage data as an attribute to the climate entities https://github.com/MizterB/homeassistant-infinitude/pull/54
@MizterB did you, by any chance, have time to look at my pull request? Is there any way, I can help or assist?
@sytchi how can we expose the energy data into home assistant from here? edit could probably just do something like this: https://www.home-assistant.io/integrations/sensor.rest/
@eightbitreaper Here is a gist for the sensors I created. Of course, you'd need to adjust the resource variables at a minimum to work for your system's configuration.
At first glance after a few days of recording, the data didn't seem too accurate. Please let me know what you find out.
Also, here is a spreadsheet to properly format the json templates based on which data you're trying to record:
@sytchi Is this how you went about it in your fork?
@nebulous Look about right?
What I did, basically trades off REST for template sensors. If you have the latest code, you should see all the values of energy usage in the energy property of your thermostat. then you can create your sensors with template sensor like that (i did not include all measurements in the example):
- platform: template
sensors:
gas_usage_yesterday:
friendly_name: "Gas usage yesterday"
unit_of_measurement: "ft³"
device_class: gas
value_template: "{{ state_attr('climate.living_room', 'energy').day1.gas }}"
unique_id: f8bc2af7-ae69-4062-b145-e5cbf3229fc4
gas_usage_day_before:
friendly_name: "Gas usage the day before"
unit_of_measurement: "ft³"
device_class: gas
value_template: "{{ state_attr('climate.living_room', 'energy').day2.gas }}"
unique_id: fada92cd-4c89-42cf-8a29-78695341c64b
gas_usage_monthly:
friendly_name: "Gas usage monthly"
unit_of_measurement: "ft³"
device_class: gas
value_template: "{{ state_attr('climate.living_room', 'energy').month1.gas }}"
unique_id: 371ed348-4449-48d4-9169-c9c8f4e2422f
gas_usage_yearly:
friendly_name: "Gas usage yearly"
unit_of_measurement: "ft³"
device_class: gas
value_template: "{{ state_attr('climate.living_room', 'energy').year1.gas }}"
unique_id: a9e0df01-1aed-4a6e-8813-0655fe78088b
fan_energy_usage_yesterday:
friendly_name: "Fan energy usage yesterday"
unit_of_measurement: "kWh"
device_class: energy
value_template: "{{ state_attr('climate.living_room', 'energy').day1.gas }}"
unique_id: a5d4a742-bab4-45dc-9272-99ab0d87f924
fan_energy_usage_monthly:
friendly_name: "Fan energy usage monthly"
unit_of_measurement: "kWh"
device_class: energy
value_template: "{{ state_attr('climate.living_room', 'energy').month1.fan }}"
unique_id: 1e8a808c-b044-43ca-997c-4c7205d8bd63
I think it would be great to add a config option to the integration that would automatically create these sensors. I didn't have time to prepare such code change though.
For reference the structure of the properties for your climate entity should look something like this:
hvac_modes: off, heat, cool, heat_cool, fan_only
min_temp: 7
max_temp: 35
fan_modes: auto, high, medium, low
preset_modes: Schedule, Home, Away, Sleep, Wake, Override, Hold
current_temperature: 21
temperature: 20
current_humidity: 49
fan_mode: low
hvac_action: idle
preset_mode: Hold
current_activity: home
scheduled_activity: null
scheduled_activity_start: null
next_activity: sleep
next_activity_start: 2023-05-01T02:00:00
hold_state: on
hold_activity: home
hold_until: null
outdoor_temperature: null
humid: off
filtrlvl: 30
humlvl: 100
ventlvl: 100
uvlvl: 100
idu_modulation: null
airflow_cfm: null
occupancy: null
energy:
day1:
looppump: 0
reheat: 0
hpheat: 0
fangas: 0
fan: 4
eheat: 0
gas: 8
cooling: 0
day2:
fan: 5
gas: 0
eheat: 0
cooling: 0
looppump: 0
reheat: 0
fangas: 0
hpheat: 0
month1:
eheat: 0
gas: 4019
cooling: 0
fan: 87
hpheat: 0
fangas: 0
looppump: 0
reheat: 0
month2:
hpheat: 0
fangas: 0
reheat: 0
looppump: 0
cooling: 0
eheat: 0
gas: 6572
fan: 60
year1:
fan: 347
cooling: 0
eheat: 0
gas: 19463
reheat: 0
looppump: 0
hpheat: 0
fangas: 0
year2:
fan: 978
gas: 41246
eheat: 0
cooling: 772
looppump: 0
reheat: 0
fangas: 0
hpheat: 0
friendly_name: living room
supported_features: 25
@sytchi That functionality is still only in your branch that's still a pending PR, right?
It's on master branch in this repository. The version however stayed 0.7.2 so in HACS you have to manually select "master" instead of 0.7.2
Or @MizterB - maybe we could bump the version to 0.7.3 ?
Implemented as an Energy sensor attribute in https://github.com/MizterB/homeassistant-infinitude-beyond