How to Edit Existing Entities?

Hi,

byy default HA only updates mqtt entities when the value changes.
For my manually added mqtt sensors I found a solution:

force_update: true in configuration.yaml for every mqtt sensor.

But I have some auto discovered IPP entities here which shows the same behavior. The values are only updated when the changed. For a printer with the toner this is no good.

Now my question is:

How can I add this to the discovered IPP entities?

Or is there another way to let HA update the automated devices? Even if the data has not changed?

Thanks!

/KNEBB

you can use the “homeassistant.update_entity” service in an automation action to force an update to any entity.

Hi,

and thanks for the input. I created now an automation rule (through GUI) which fires every five minutes.

id: '1634883135482'
alias: Update Drucker (5min)
description: Die Infos vom Drucker werden alle fünf Minuten geholt
trigger:
  - platform: time_pattern
    hours: '*'
    minutes: /5
    seconds: '0'
    id: ecosyshome
condition: []
action:
  - service: homeassistant.update_entity
    target:
      device_id: 81f7a7694240fcfc284e0e8af743e8f7
mode: single

So far looks good, I would say…

When I check the result in the “trace - trace timeline” I see:

Stopped because an error was encountered at 22. Oktober 2021, 08:12:26 (runtime: 0.01 seconds)
extra keys not allowed @ data['device_id]'

Data does not get updated on the device. It still shows “Yesterday”.

Any Ideas for further troubleshooting?

/KNEBB

Not really. The automation actions look fine to me from my understanding but I’ve never used any device automation. I only ever use entities. (And tbh I’ve never used that service either.)

Try to update the entity instead of the device and see if that works without errors.

Also unless you reply directly to me using the reply button in my post or use my user name with @ (like @knebb ) then I don’t get notified you replied to me and I don’t see the reply until I look thru my unread thread list.

Try with the entity_id instead of the device_id

Good idea! I wish I would have thought of that. :wink: :laughing:

@francisp @finity
Well, thanks for the hints. But still nothing changes.
THis is the current configuration.yaml:

- id: '1634883135482'
  alias: Update Drucker (5min)
  description: Die Infos vom Drucker werden alle fünf Minuten geholt
  trigger:
  - platform: time_pattern
    hours: '*'
    minutes: /5
    seconds: '0'
    id: ecosyshome
  condition: []
  action:
  - service: homeassistant.update_entity
    target:
      entity_id: sensor.ecosys_m5526cdn_black_tk_5240k
  mode: single

And this is how it looks in Garafana:

You can see the Magenty entry as there something was printed and thus the value changed.

And in hoas itself:
grafik

Am I getting something wrong?

The trace does not show any errors.

Anyways, somehow strange…

Further ideas?

/KNEBB

you said the sensor comes thru MQTT?

If so are you sure the values are getting sent to/received by HA?

to test it you could send a different test value to that MQTT topic and see if HA picks up the changed value.

I use MQTTFx for that but any client should do it.

I probably wouldn’t use HA as the publisher since that’s what you are trying to troubleshoot.

@finity
Hi,

no, not through MQTT. I was just able to get the mentioned action for the other sensors (which are popping in through mqtt, indeed).

But the above item in question is an auto-discovered IPP printer (Kyocera laser) .

So no mqtt involved here…

well…then…I have no idea how to proceed from here.

One last possible resort…

Have you tried removing the printer integration and re-adding it?

Sorry I can’t help more.