Times of the Day Binary Sensor

Is it me or is this simple sensor incredibly confusing?

Firstly, why call it tod? What would have been wrong with the much more descriptive times_of_day?

Also, I find the naming of the configuration variables to be non intuitive to say the least…


before - surely it should be start or at?
after - surely it should be end or to?
(with before_offset and after_offset renamed accordingly)

Unless if course it is just me :wink:

1 Like

oh no, That calls for another breaking change !
I get what you say though and agree with your comments.

Ha! yes. You don’t get much more breaking than changing the sensor name and it’s configuration variables :slight_smile:

I say let’s do it (but let’s wait a few months for best effect!) :wink:

1 Like

Yes, I agree - the sensor’s a good idea, but all of those suggestions would make it a better one. Needs to be done ASAP before it becomes too popular!

I haven’t looked at submitting changes to the core - I guess there’s a pull request process…

I think I’m sticking with my own sensor for now.

Yeah… I have my own too. I wanted to change but gave up trying to work out how to use this new one. It wasn’t worth the effort for something so simple. Which is a shame.

I totally agree, it is unnecessarily confusing.

Consider the following setup…

- platform: tod
  name: "TOD Dawn"
  after: sunrise
  after_offset: '-01:00:00'
  before: sunrise
  before_offset: '01:00:00'

After sunrise with an offset of minus one hour? But isn’t that before sunrise?!

And before sunrise with an offset of plus one hour? Well that’s actually after sunrise isn’t it?

It messes with my head! Surely something like the following would be more appropriate…

- platform: tod
  name: "TOD Dawn"
  turn_on: sunrise
  offset: '-01:00:00'
  turn_off: sunrise
  offset: '01:00:00'

It looks like we’re* stuck with it as it is unless they decided to…


*I use the term loosely because as I said I chose not to use it.