#I can use the coordinator here right? I

1 messages ยท Page 1 of 1 (latest)

fresh nymph
#

now you're starting to overask me ๐Ÿ™‚

brave nest
#

I guess I need @young musk input here ๐Ÿ™‚

young musk
#

hi

fresh nymph
#

๐Ÿ‘‹

young musk
#

Hmm

#

I think its strange to have an event entity to say like

#

stuff got updated

#

without answering the question what got updated

#

This is like whatsapp giving you a notification: "You may have new messages"

brave nest
#

It does that sometimes ๐Ÿคฃ

young musk
#

and its annoying lol

brave nest
#

When there is bad connection

young musk
#

yep

#

But I think that is an annoying pattern, so preferably we also should not introduce that here imo

brave nest
#

Yes you're right

brave nest
#

So what do you think we can do here? The only thing I can think of is a timer trigger that will call the service each time.. but I'm not sure how I compare the results?

fresh nymph
#

And what if you just send an event on every change, with the old status and the new status of the package, like the event sent for an entity state change.
Then in the automation an event trigger can be used

brave nest
#

that event will hold both data? old + new?

fresh nymph
#

This is an example of a state_changed event, as you can see it holds the new and old state

event_type: state_changed
data:
  entity_id: sensor.power_production_phase_l3
  old_state:
    entity_id: sensor.power_production_phase_l3
    state: "0.581"
    attributes:
      state_class: measurement
      unit_of_measurement: kW
      device_class: power
      friendly_name: Electricity Meter Energieproductie Fase L3
    last_changed: "2024-05-20T06:59:06.942414+00:00"
    last_reported: "2024-05-20T06:59:06.942414+00:00"
    last_updated: "2024-05-20T06:59:06.942414+00:00"
    context:
      id: 01HYACQYHYDY8AH8NVRKGX1XQ4
      parent_id: null
      user_id: null
  new_state:
    entity_id: sensor.power_production_phase_l3
    state: "0.58"
    attributes:
      state_class: measurement
      unit_of_measurement: kW
      device_class: power
      friendly_name: Electricity Meter Energieproductie Fase L3
    last_changed: "2024-05-20T06:59:12.965140+00:00"
    last_reported: "2024-05-20T06:59:12.965140+00:00"
    last_updated: "2024-05-20T06:59:12.965140+00:00"
    context:
      id: 01HYACR4E5P0Z9HTXHKZ4FQFF3
      parent_id: null
      user_id: null
origin: LOCAL
time_fired: "2024-05-20T06:59:12.965140+00:00"
context:
  id: 01HYACR4E5P0Z9HTXHKZ4FQFF3
  parent_id: null
  user_id: null
brave nest
#

@young musk this looks good right?

#

@fresh nymph do you know of an integration that does this today? So I can have a refrence to the code

young musk
#

I have some time to dive later