====== Electrical current sensor ======
**TLDR** [[https://hass.telavivmakers.space/history?entity_id=sensor.cc_power0%2Csensor.cc_power_total%2Csensor.cc_power1%2Csensor.cc_power2&start_date=2023-07-19T21%3A00%3A00.000Z&end_date=2023-07-20T23%3A00%3A00.000Z|hass>current_phases + total]]
example\\
{{:tamiwiki:other:pasted:20230716-184815.png?600}}
==== TODO: ====
* finish mqtt integration
* sum the three current sensors to one [[https://community.home-assistant.io/t/172779|link]]
* kill all our consumers and calculate the base (we share power with upstairs)
* remove (or integrate to ) the default energy tab
* integrate ''$/hour'' to the page
* tami energy price node-red bot
* monitor upstairs meter
==== what we haz ====
our current sensor is clamped onto our three main arteries
and is streamed using [[https://github.com/merbanan/rtl_433|rtl_433]] \\
running on the [[https://hass.telavivmakers.space|HomeAssistant]] "cloud" machine
==== mqtt ====
push it to over mqtt, using
sudo rtl_433 -F "mqtt://10.81.2.3:1883,user=tami,pass=tamispace"
using service
yair@telavivmakers:~$ sudo systemctl restart rtl433.service
==== hass ====
and from there to the homeassistant
in hass, as our sensor does not conform to the standard ''power_w'' expected output. \\
a solution [[https://github.com/pbkhrv/rtl_433-hass-addons/issues/101#issuecomment-1190281549|was found]], and integrated to hass [[https://www.home-assistant.io/docs/configuration/|configuration.yaml]]
**tl;dr**
add the following to the ''root@telavivmakers:/home/yunohost.app/homeassistant/configuration.yaml'' \\
and reload the yaml (''Developer Tools/yaml'')
test new yaml in (''Developer Tools/template'')
mqtt:
sensor:
- name: cc_power0
state_topic: rtl_433/74930c0d-rtl433/devices/CurrentCost-TX/3202/power0_W
device_class: power
unit_of_measurement: W
state_class: measurement
value_template: "{{ value | round() }}"
- name: cc_power1
state_topic: rtl_433/74930c0d-rtl433/devices/CurrentCost-TX/3202/power1_W
device_class: power
unit_of_measurement: W
state_class: measurement
value_template: "{{ value | round() }}"
- name: cc_power2
state_topic: rtl_433/74930c0d-rtl433/devices/CurrentCost-TX/3202/power2_W
device_class: power
unit_of_measurement: W
state_class: measurement
value_template: "{{ value | round() }}"
to sum the three meters and convert to Kw. add
sensor:
- platform: template
sensors:
cc_power_total:
friendly_name: "Energy (total)"
unit_of_measurement: 'W'
device_class: power
value_template: "{{ states('sensor.cc_power0') |float + states('sensor.cc_power1')|float + states('sensor.cc_power2') | float }}"
- platform: integration
source: sensor.cc_power_total
name: energy_spent
unit_prefix: k
round: 2
reload yaml \\
then add ''energy_spent'' to ''config/energy'' as ''Grid consumption''
===== aircon =====
[[tamiwiki:other:aircon|aircon]]