Skip to content

Commit

Permalink
0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lolouk44 committed Aug 19, 2021
1 parent 276fe96 commit ccefd09
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.2.0] - 2021-08-19
### Added
- Added handling of temperature in Fahrenheit

## [0.2.0] - 2021-08-11
### Added
- Added last 24h and last 30 days energy used in KWh to the attributes
Expand Down
7 changes: 6 additions & 1 deletion custom_components/currentcost/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ async def serial_read(self, device, rate, **kwargs):
except:
appliance = None
pass

temperature = None
try:
temperature = float(data['msg']['tmpr'])
except:
temperature = None
pass
try:
temperature = float(data['msg']['tmprF'])
except:
pass
try:
imp = int(data['msg']['imp'])
Expand Down
4 changes: 2 additions & 2 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ sensor:
template:
- sensor:
- name: "CurrentCost Temperature"
unit_of_measurement: '°C'
state: '{{ state_attr("sensor.current_cost", "Temperature") | float -3 }}' # Manual adjustment of -3°C in case the temp sensor is high than real temperature
unit_of_measurement: '°C' # or °F for Fahrenheits
state: '{{ state_attr("sensor.current_cost", "Temperature") | float -3 }}' # Manual adjustment of -3°C in case the temp sensor is higher than real temperature
device_class: temperature
state_class: measurement # Add state_class: measurement for long term statistics are required
- sensor:
Expand Down

0 comments on commit ccefd09

Please sign in to comment.