Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0.0 does not trigger correctly when sensors updated #65

Closed
borpin opened this issue Mar 19, 2022 · 7 comments
Closed

V2.0.0 does not trigger correctly when sensors updated #65

borpin opened this issue Mar 19, 2022 · 7 comments

Comments

@borpin
Copy link
Contributor

borpin commented Mar 19, 2022

V2.0.0 does not work when the sensors are updated.

I have 2 x Scales defined and both updated when one set of sensors updated.

Node-Red did not pick up the state change so something is amiss.

Reverted to 1.1.5 and all OK.

@dckiller51
Copy link
Owner

hello, @edenhaus is working on a update that should bring some corrections.

@edenhaus
Copy link
Collaborator

Can you please describe your setup with Node Red.
Is the sensor (bodymiscale.YOURNAME) in HA updated correctly with v2?

@borpin
Copy link
Contributor Author

borpin commented Mar 20, 2022

All Node-RED is doing is waiting for the bodymiscale entity state to change (update).

image

entity state - Last Changed date is the first time it ran having reverted to V1.1.5, Last Updated was the reading this morning.

image

Is the sensor (bodymiscale.YOURNAME) in HA updated correctly with v2?

Seems to have as it doesn't work once updated.

As I said, I have 2 people defined (so 2 entities) and both entities get updated at the same time (i.e. when one set of weight/impedance sensors update) on V2.0 even though the 2 bodymiscale entities are linked to different sensors.

@edenhaus
Copy link
Collaborator

I will verify it by the end of this week (Currently I'm on holiday).

As I said, I have 2 people defined (so 2 entities) and both entities get updated at the same time (i.e. when one set of weight/impedance sensors update) on V2.0 even though the 2 bodymiscale entities are linked to different sensors.

Can you please share your config as I don't understand how both entities can be updated the same time with different sensors (scales) configured

@borpin
Copy link
Contributor Author

borpin commented Mar 20, 2022

Can you please share your config as I don't understand how both entities can be updated the same time with different sensors (scales) configured

No neither do I - it shouldn't - only happens with V2!!!

scale_brian:
  sensors:
    weight: sensor.weight_brian
    impedance: sensor.impedance_brian
  height: 182
  born: "xxxx-xx-xx"
  gender: "male"
  model_miscale: "181B"

scale_k:
  sensors:
    weight: sensor.weight_k
    impedance: sensor.impedance_k
  height: 163
  born: "xxxx-xx-xx"
  gender: "female"
  model_miscale: "181B"

Can you also check the new code fixes issue #51 at the same time. Needs to wait for both sensors to update before reporting else it seems to use the impedance from last time.

@edenhaus
Copy link
Collaborator

edenhaus commented Apr 9, 2022

I cannot reproduce your issue.

The entity is updated correctly when one of it sensors get a new state and only the specific entity and not all bodymiscale entities.

I used the following config for testing:

input_number:
  weight:
    name: Weight
    initial: 70
    min: 10
    max: 200
    step: 0.1
  impedance:
    name: Impedance
    initial: 400
    min: 0
    max: 3000
    step: 1
  weight2:
    name: Weight
    initial: 80
    min: 10
    max: 200
    step: 0.1
  impedance2:
    name: Impedance
    initial: 600
    min: 0
    max: 3000
    step: 1

bodymiscale:
  test:
    sensors:
      weight: input_number.weight
      impedance: input_number.impedance
    height: 180
    born: "1990-01-01"
    gender: "male"
    model_miscale: "181B"

  test2:
    sensors:
      weight: input_number.weight2
      impedance: input_number.impedance2
    height: 180
    born: "1990-01-01"
    gender: "male"
    model_miscale: "181B"

@edenhaus
Copy link
Collaborator

edenhaus commented Apr 9, 2022

image

Wait coming back to this screenshot...

The entity bodymiscale has as state the status (OK, problem,...). If the state is already on OK and your new reading is fine, the state will be also OK, but the attributes have changed. Therefore HA is only updating the attributes and leave the state as it is. Therefore only the last_updated value is changing, which is correct.

To get all attributes changes, you need to change your config on Node Red. As you currently only are listing for change changes and the state remains OK.

As I have written in #61 (comment) I will add an sensor for each attribute in the future, so you can directly use them in Node Red if you need it.

P.S.: As HA is optimizing the performance a lot in the last releases and also deprecating old (slow, incorrect) ways, probably 1.1.5 will stopping to work in future releases.

@dckiller51 Issue can be closed imo, as no change on our side is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants