pbkhrv / rtl_433-hass-addons

Collection of Home Assistant add-ons that use rtl_433
240 stars 109 forks source link

CurrentCost power values #101

Closed glendower closed 2 years ago

glendower commented 2 years ago

Currentcost power devices still not coming through.

INFO:root:Skipped CurrentCost-EnviR/3373: power0_W, power1_W, power2_W INFO:root:Published CurrentCost-TX/1155: time INFO:root:Skipped CurrentCost-TX/1155: power0_W, power1_W, power2_W

I forked the repo and tried to change the file rtl_433_mqtt_hass.py to:-

"power_W": {
    "device_type": "sensor",
    "object_suffix": "watts",
    "config": {
        "device_class": "power",
        "name": "Power",
        "unit_of_measurement": "W",
        "value_template": "{{ value|float }}",
        "state_class": "measurement"
    }
},

"power0_W": {
    "device_type": "sensor",
    "object_suffix": "watts",
    "config": {
        "device_class": "power",
        "name": "Power",
        "unit_of_measurement": "W",
        "value_template": "{{ value|float }}",
        "state_class": "measurement"
    }
}

but it didn't work

glendower commented 2 years ago

I have managed to get a working solution for CurrentCost devices. I used the Mosquitto Broker with the following topic to extract power0_W:

  rtl_433/e89dd810-rtl433/devices/CurrentCost-EnviR/CC device number/power0_W

and to extracted this value into a sensor

mqtt
  sensor
    - name: cc_power0
      state_topic: "rtl_433/e89dd810-rtl433/devices/CurrentCost-EnviR/CC device number/power0_W"
      device_class: power
      unit_of_measurement: "W"
      state_class: measurement
      value_template: "{{ value | round() }}""