Olen / homeassistant-plant

Alternative Plant component of home assistant
218 stars 23 forks source link

Odd sensor bahaviour. #146

Closed jonnybergdahl closed 2 months ago

jonnybergdahl commented 4 months ago

I have one plant that seems to use the wrong moisture sensor. I checked the core.config_entries and it shows the correct sensor (the _d one) being used.

        "title": "Rosmarin GCKN",
        "data": {
          "plant_info": {
            "name": "Rosmarin GCKN",
            "species": "rosmarinus officinalis",
            "temperature_sensor": "sensor.growcube_c13acc_temperature",
            "moisture_sensor": "sensor.growcube_c13acc_moisture_d",

However, the sensor.rosmarin_gckn_soil_moisture sensor shows these attributes, saying it uses the (faulty) _a one?


external_sensor: sensor.growcube_c13acc_moisture_a
unit_of_measurement: "%"
device_class: moisture
icon: mdi:water
friendly_name: Rosmarin GCKN soil moisture```

Not sure how to even troubleshoot this.

I have deleted this plant, restarted, and re-added 3 times, and the result was the same every time.
Olen commented 4 months ago

Try the replace_sensor service call (see the readme) and check if that helps.

jonnybergdahl commented 4 months ago

Thanks, that did the job. Not sure how this could happen though, is HA secretly caching entities, even to the point of surviving a restart?

Olen commented 2 months ago

HA is extremely good at preserving stuff even through deleting an entity and creating a new with the same name/entity_id.