Why doesn't this work?

hi.
my home assistant is trying to drive me nuts. i defined a few sensor entities for my kitchen, and they work. so i copied that block and changed the info for my bedroom, and those entities don’t exist. i can’t find out why, and it’s driving me round the bend :frowning:
reloading yaml configuration, restarting and even rebooting did not change anything, those bedroom entities stubbornly refuse to appear.
the blocks for the kitchen and the bedroom are identical (apart from entity names) but the bedroom sensors just don’t appear. when i go to the states tab in the developer tools and enter the entity names, it says “no entities”.

am i doing something wrong? is this some weird bug in home assistant? what is going on?

how about show us the YAML dont forget to format it correctly

here it is:

  - platform: history_stats
    name: "Bedroom heater DC (24)"
    unique_id: "bdc24"
    entity_id: switch.bedroom_heater_switch
    state: "on"
    type: ratio
    duration:
      hours: 24
    end: >
      {{ now() }}

  - platform: history_stats
    name: "Kitchen heater DC (24)"
    unique_id: "kdc24"
    entity_id: switch.kitchen_heater_switch
    state: "on"
    type: ratio
    duration:
      hours: 24
    end: >
      {{ now() }}

like i said, the one for the kitchen works, but the one for the bedroom doesn’t, and i can’t find out why :frowning:

so you see the

switch.kitchen_heater_switch

in the states screen

but you don’t see the

switch.bedroom_heater_switch

in the states screen

so how did you get the switch.kitchen_heater_switch can’t you that the same logic for the bedroom one

Check Settings → System → Logs

no, those 2 entities are not the problem, they work normally. it’s the kdc24 (works) and bdc24 (doesn’t work).

what is the kdc24 show us a screen shot of it.

it’s the kitchen heater duty cycle over the last 24 hours. bdc24 is the same for the bedroom. and i also have 48 hour versions of both.

The entity id’s will be: sensor.bedroom_heater_dc_24 and sensor.kitchen_heater_dc_24 the unique_id does not generate this, the name does.

And again:

the weird thing is, the 2 kitchen entities appear as sensor.kdc24 and sensor.kdc48, as expected, and the 2 bedroom entities appear as sensor.bedroom_heater_dc_24 and sensor.bedroom_heater_dc_48.

That is not “as expected”.

1 Like