diff --git a/.gitignore b/.gitignore index 1b680ad..309f1ad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /*/ !.gitignore !configuration.yaml +!packages/ diff --git a/configuration.yaml b/configuration.yaml index 7057528..e121629 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -7,6 +7,8 @@ homeassistant: time_zone: !secret timezone_home unit_system: metric + packages: !include_dir_named packages + frontend: discovery: history: diff --git a/packages/mysensors.yaml b/packages/mysensors.yaml new file mode 100644 index 0000000..8aeb4a0 --- /dev/null +++ b/packages/mysensors.yaml @@ -0,0 +1,43 @@ +homeassistant: + customize: + package.node_anchors: + common: &common + package: "mysensors" + + customize_glob: + sensor.vardagsrum_0: + <<: *common + friendly_name: Vardagsrummet + sensor.elmatare_*: + <<: *common + sensor.elmatare_20*: + hidden: true + sensor.elmatare_0: + friendly_name: Utomhus + sensor.power_meter: + <<: *common + friendly_name: Elförbrukning + + light.skrivbordslampa_1: + <<: *common + friendly_name: Skrivbordslampa + + +mysensors: + gateways: + - device: !secret swarm_ip + tcp_port: !secret mysensors_port + nodes: + 2: { name: Vardagsrum } + 24: { name: Skrivbordslampa } + 26: { name: Elmätare } + version: 2.0 + +# The power meter has two values for one sensor, and which one is logged is a bit random. Therefore replace it with a custom template sensor which always gets the correct value + +sensor: + - platform: template + sensors: + power_meter: + value_template: "{{ states.sensor.elmatare_20.attributes.V_WATT }}" + unit_of_measurement: 'W'