Giter VIP home page Giter VIP logo

Comments (10)

Olen avatar Olen commented on August 18, 2024 1

If you get the "Refuse to update..." error, it probably means that you mix up the two entries in the service call.

  • meter_entity is the entity_id of the sensor that is part of the plant.
  • new_sensor is the entity_id of the physical sensor that you want the meter_entity to get its data from.

What I personally do, to make a clearer separation between them, is that all my physical sensors (e.g BLE-devices) have generic entity_ids like "sensor.ble_sensor_1_moisture", "sensor.ble_sensor_1_illumination", "sensor.ble_sensor_2_conductivity" etc.
And all my plants sensors have entity_ids like "sensor.rose_moisture", "sensor.chili_conductivity" etc.

That way, if I need to replace a (physical) sensor, it is very easy to grasp the concept and use

service: plant.replace_sensor
data:
  meter_entity: sensor.rose_illumination
  new_sensor: sensor.ble_sensor_12_illumination

from homeassistant-plant.

southwestflavorz avatar southwestflavorz commented on August 18, 2024

I'm experiencing similar issues. I've created 5 plants thus far, 2 have unknown for values. One does not have specific values. All of these values are present in the "base" sensor.

from homeassistant-plant.

Olen avatar Olen commented on August 18, 2024

Please enable debug log of the custom_components.plant integration.

from homeassistant-plant.

chrisb86 avatar chrisb86 commented on August 18, 2024

Somehow the wrong sensor is used for the plant. The entites with "miflora" in it where the entity ids when I integrated the sensors the old ESPhome way.

They were deleted and I searched in /config/.storage and couldn't find any references to the old sensors. I don't know, where the integration remembers the old entities and why it uses them.

2022-09-12 10:17:50.642 DEBUG (MainThread) [custom_components.plant] Setting up config entry 7ce9a3ca5abcacd91f13a925fe40c2bb: <homeassistant.config_entries.ConfigEntry object at 0x7f426708d080> 2022-09-12 10:17:51.035 DEBUG (MainThread) [custom_components.plant.number] {'plant_info': {'name': 'Kinderzimmer Bogenhanf', 'species': 'sansevieria zeylanica', 'temperature_sensor': 'sensor.plant_sensor_6db18c_temperature', 'moisture_sensor': 'sensor.plant_sensor_6db18c_moisture', 'conductivity_sensor': 'sensor.plant_sensor_6db18c_conductivity', 'illuminance_sensor': 'sensor.plant_sensor_6db18c_illuminance', 'search_for': 'sansevieria zeylanica', 'entity_picture': '', 'display_pid': 'Sansevieria Zeylanica', 'limits': {'max_moisture': 60, 'min_moisture': 20, 'max_illuminance': 100000, 'min_illuminance': 0, 'max_dli': 30, 'min_dli': 2, 'max_temperature': 40, 'min_temperature': 10, 'max_conductivity': 3000, 'min_conductivity': 500, 'max_humidity': 60, 'min_humidity': 20}}} 2022-09-12 10:17:51.386 DEBUG (MainThread) [custom_components.plant.sensor] {'plant_info': {'name': 'Kinderzimmer Bogenhanf', 'species': 'sansevieria zeylanica', 'temperature_sensor': 'sensor.plant_sensor_6db18c_temperature', 'moisture_sensor': 'sensor.plant_sensor_6db18c_moisture', 'conductivity_sensor': 'sensor.plant_sensor_6db18c_conductivity', 'illuminance_sensor': 'sensor.plant_sensor_6db18c_illuminance', 'search_for': 'sansevieria zeylanica', 'entity_picture': '', 'display_pid': 'Sansevieria Zeylanica', 'limits': {'max_moisture': 60, 'min_moisture': 20, 'max_illuminance': 100000, 'min_illuminance': 0, 'max_dli': 30, 'min_dli': 2, 'max_temperature': 40, 'min_temperature': 10, 'max_conductivity': 3000, 'min_conductivity': 500, 'max_humidity': 60, 'min_humidity': 20}}} 2022-09-12 10:17:51.387 INFO (MainThread) [custom_components.plant.sensor] Added external sensor for None sensor.plant_sensor_6db18c_illuminance 2022-09-12 10:17:51.425 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.kinderzimmer_bogenhanf_illuminance external sensor to sensor.miflora_c47c8d6db18c_illuminance 2022-09-12 10:17:51.426 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.kinderzimmer_bogenhanf_conductivity external sensor to sensor.miflora_c47c8d6db18c_conductivity 2022-09-12 10:17:51.426 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.kinderzimmer_bogenhanf_soil_moisture external sensor to sensor.miflora_c47c8d6db18c_moisture 2022-09-12 10:17:51.426 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.kinderzimmer_bogenhanf_temperature external sensor to sensor.miflora_c47c8d6db18c_temperature 2022-09-12 10:17:51.427 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.kinderzimmer_bogenhanf_ppfd_mol external sensor to sensor.kinderzimmer_bogenhanf_illuminance

from homeassistant-plant.

Olen avatar Olen commented on August 18, 2024

Try to use the replace_sensor service call instead of removing and re-adding plants.
HA is very insistent on restoring and reusing previous entities when a new sensor is added with the same entity id as a former one.

from homeassistant-plant.

alexiri avatar alexiri commented on August 18, 2024

I had this same issue and calling replace_sensor worked for me. Thanks!

from homeassistant-plant.

mdrichardson avatar mdrichardson commented on August 18, 2024

I'm having the same issue after renaming one of the plants' BLE integration. It used to be yucca and is now dracaena. I tried replacing the sensors, but get (debug logging is enabled and this is all that's shown):

Refuse to update non-plant entities: sensor.yucca_illuminance

...for all the sensor.yucca_ variants.

Relevant debug logs:

2022-09-27 17:18:24.926 DEBUG (MainThread) [custom_components.plant.number] {'plant_info': {'name': 'Dracaena', 'species': 'dracaena fragrans', 'temperature_sensor': 'sensor.dracaena_temperature', 'moisture_sensor': 'sensor.dracaena_moisture', 'conductivity_sensor': 'sensor.dracaena_conductivity', 'illuminance_sensor': 'sensor.dracaena_illuminance', 'search_for': 'Dracaena Fragrans', 'data_source': 'openplantbook', 'entity_picture': 'https://opb-img.plantbook.io/dracaena%20fragrans.jpg', 'display_pid': 'Dracaena fragrans', 'limits': {'max_moisture': 60, 'min_moisture': 15, 'max_illuminance': 50000, 'min_illuminance': 2000, 'max_dli': 23, 'min_dli': 10, 'max_temperature': 95, 'min_temperature': 50, 'max_conductivity': 1500, 'min_conductivity': 200, 'max_humidity': 85, 'min_humidity': 30}}}

2022-09-27 17:18:25.492 DEBUG (MainThread) [custom_components.plant.sensor] {'plant_info': {'name': 'Dracaena', 'species': 'dracaena fragrans', 'temperature_sensor': 'sensor.dracaena_temperature', 'moisture_sensor': 'sensor.dracaena_moisture', 'conductivity_sensor': 'sensor.dracaena_conductivity', 'illuminance_sensor': 'sensor.dracaena_illuminance', 'search_for': 'Dracaena Fragrans', 'data_source': 'openplantbook', 'entity_picture': 'https://opb-img.plantbook.io/dracaena%20fragrans.jpg', 'display_pid': 'Dracaena fragrans', 'limits': {'max_moisture': 60, 'min_moisture': 15, 'max_illuminance': 50000, 'min_illuminance': 2000, 'max_dli': 23, 'min_dli': 10, 'max_temperature': 95, 'min_temperature': 50, 'max_conductivity': 1500, 'min_conductivity': 200, 'max_humidity': 85, 'min_humidity': 30}}}
2022-09-27 17:18:25.492 INFO (MainThread) [custom_components.plant.sensor] Added external sensor for None sensor.dracaena_illuminance

2022-09-27 17:18:25.628 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.dracaena_illuminance_2 external sensor to sensor.yucca_illuminance
2022-09-27 17:18:25.629 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.dracaena_conductivity_2 external sensor to sensor.yucca_conductivity
2022-09-27 17:18:25.629 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.dracaena_soil_moisture external sensor to sensor.yucca_moisture
2022-09-27 17:18:25.629 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.dracaena_temperature_2 external sensor to sensor.yucca_temperature
2022-09-27 17:18:25.629 INFO (MainThread) [custom_components.plant.sensor] Setting sensor.dracaena_ppfd_mol external sensor to sensor.dracaena_illuminance_2

From the BLE integration:

image
image

From the Plant Monitor integration:

image
image

from homeassistant-plant.

Olen avatar Olen commented on August 18, 2024

I updated the README with the above example, which hopefully makes it a bit clearer.

from homeassistant-plant.

renaiku avatar renaiku commented on August 18, 2024

I had the same issue with also Miflora and bluetooth proxies. Solved it as you said using plant.replace_sensor and everything works perfectly.

from homeassistant-plant.

mdrichardson avatar mdrichardson commented on August 18, 2024

@Olen, that's much more clear. Thank you!

from homeassistant-plant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.