Closed Dutchy-79 closed 11 months ago
Can you show a screenshot of the sensor.gas_station_3580_lpg1
entity? I think you have multiple.
Bottom one says unknown, top probably old.
If your automation runs automatically, disable it, restart home assistant. remove the bottom one. Enable your automation and it should be working again.
Okay, disable automation Delete sensor Reboot HA Enable automation Run automation
No new sensor
Log shows
[2023-10-19 10:21:36] INFO : Received payload '{"station_id":3580,"fuel_type":"lpg"}' on topic 'dgp/gas_station' [2023-10-19 10:21:39] INFO : publishing station_id 3580 to mqtt [2023-10-19 10:21:40] WARNING : Unable to find sensor with url 'http://supervisor/core/api/states/sensor.gas_station_3580_lpg', status code is '404'
Checked is station_id didn't change
Restarted everything again.
Here's the log
s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting
s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to INFO s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [11:09:26] INFO: Log_level: info [11:09:26] INFO: mqtt_host: core-mosquitto [11:09:26] INFO: mqtt_port: 1883 [11:09:26] INFO: Starting dutch gas prices... [2023-10-19 11:09:27] INFO : DGP initialized, launching client [2023-10-19 11:09:27] INFO : Connecting to mqtt host 'core-mosquitto' with clientname 'f5a8083e-dutch-gas-prices' [2023-10-19 11:09:27] INFO : Using username 'mqtt' to connect to 'core-mosquitto' [2023-10-19 11:09:27] INFO : Connected with result code '0' [2023-10-19 11:09:56] INFO : Received payload '{"station_id":3580,"fuel_type":"lpg"}' on topic 'dgp/gas_station' [2023-10-19 11:10:00] INFO : publishing station_id 3580 to mqtt [2023-10-19 11:10:01] WARNING : Unable to find sensor with url 'http://supervisor/core/api/states/sensor.gas_station_3580_lpg', status code is '404'
The problem is that Home Assistant creates sensor.gas_station_3580_lpg_2
but dgp expects sensor.gas_station_3580_lpg
. The only way to fix this properly is to make sure the _2 is deleted, you can only delete that sensor if HA does not have an MQTT entry of that sensor. You said you executed these steps:
disable automation
Delete sensor
Reboot HA
Enable automation
Run automation
But deleting can only happen when HA does not know of the sensor, so rebooting should be done before deleting, then the MQTT entry is gone. Deleting is not really possible, or you have figured it out. How did you delete the entity?
Ty, that helped me. I think I disabled the entity _2 now I renamed the _2 sensor.gas_station_3580 lpg then run the automation and I have a value again.
Hi,
I just noticed that my sensor no longer works. It says unknown for 2 days.
Automation: alias: Update gas station lpg trigger:
Logs: [2023-10-19 07:07:00] INFO : Received payload '{"station_id":3580,"fuel_type":"lpg"}' on topic 'dgp/gas_station' [2023-10-19 07:07:04] INFO : publishing station_id 3580 to mqtt [2023-10-19 07:07:05] WARNING : Unable to find sensor with url 'http://supervisor/core/api/states/sensor.gas_station_3580_lpg', status code is '404' [2023-10-19 07:54:01] INFO : Received payload '{"station_id":3580,"fuel_type":"lpg"}' on topic 'dgp/gas_station' [2023-10-19 07:54:01] INFO : publishing station_id 3580 to mqtt [2023-10-19 07:54:02] WARNING : Unable to find sensor with url 'http://supervisor/core/api/states/sensor.gas_station_3580_lpg', status code is '404'
Regards,
Jasper