Reload sensors and binary_sensors in Configuration reloading

It would be great if you could reload both sensors and binary_sensors from the Configuration reloading section.

Is there a reason they aren’t in there now? I can’t imagine it was an oversight.

Don’t forget to vote for your own request.

Not sure why sensors don’t have their own reload. There could be some back end architectural reason that makes it difficult.

Why set the goal so low? It would be great if you didn’t have to restart/reload, period.

I’ve been using (and continue to use) another product (Premise) for over 10 years and I never have to restart/reload for any reason. I can create a new entity or automation and the system immediately registers and uses it. Modify a line in an existing automation and, if it passes the automatic code-checker, it takes effect immediately. Add a new integration and it’s immediately available. There’s simply no need to ever restart the software.

FWIW, Premise’s development started in 1998. The product changed owners twice (first to Lantronix and then to Motorola) and was ultimately discontinued by Motorola in 2006. So the software architecture it employed is hardly at the bleeding edge of what’s possible in 2019. Nevertheless, its design was way ahead of its time (and certainly feasible nowadays).

2 Likes

There are so many things that should be reloadable that aren’t.

Use AppDaemon. Everything is changeable on the fly.

What happens if you mess up an entity configuration and it tries to reload?

Nothing bad. Worst case, the entity simply doesn’t work (i.e. it fails gracefully and doesn’t crash the system).

In fact, it’s difficult to ‘mess up’ an entity’s configuration. All configuration is done with an app called Premise Builder. Imagine you’re looking at a hierarchical view of all rooms in your home. You want to add a binary_sensor to monitor the door to your bedroom. Right-click on ‘Master Bedroom’, select New > Security > DoorSensor. Done. It’s automatically assigned a name (that you can change) and is immediately displayed in the UI.

You may be thinking “Hold on a minute. What about the sensor’s integration?” That’s one of the architectural differences between Premise and Home Assistant. Premise has a clear demarcation between “virtual” and “device” layers. That DoorSensor you just added exists in the virtual realm. It’s visible in the UI, can be accessed by automations, can be used in scenes and schedules, and you can run full simulations while observing the results in the “Watch” window (shows state-changes). In other words, you can test automation logic without even connecting the entities to physical devices.

The second step is to specify the new entity’s integration. In Premise, this step is called “binding”. You “bind” the DoorSensor to a device. It’s simply a matter of dragging the desired device’s output and dropping it on the DoorSensor (or you can use the menu to select it). It’s difficult to get this step wrong because it will refuse to bind with invalid devices (i.e. can’t bind DoorSensor to a Light). The equivalent in Home Assistant would be if you specified an integration for DoorSensor that doesn’t support a binary_sensor (such as Plex) and the editor would flatly refuse to allow it.

Reviving this topic since there was no actual answer, besides mentions on how it works “correctly” in a different architecture.

Is there an actual, technical reason for the sensors not being reloadable, needing a full restart to catch up?

Before reviving a 2 year old topic it’s important to check if the information it contains is outdated. For example, if you go to Configuration > Settings you’ll see that you can reload manually configured MQTT entities and Template entities (the two integrations frequently employed to create custom sensors and binary_sensors) without having to restart Home Assistant.

It has been possible to reload them for quite awhile (at least a year).

2 Likes

I should mention I only arrived here after searching for the topic, since I didn’t know it was possible. This definitely answers for someone else googling the same thing I did :slight_smile: (this was the first result on the topic)

The main thing is that, at least for occasional users that don’t know/understand all the terminology of HA, templates wouldn’t relate directly to sensors. You can also notice this since the topic title is about “Sensors” and not “Template entities”.
Maybe that option could be renamed to “Template entities (including template sensors)” so it’s a bit clearer.

Anyhow, thanks for the response! Very helpful :tada:

1 Like

sensor and binary_sensor entities don’t exist without an associated integration.

The most common integrations that allow a user to define sensor and binary_sensor entities are MQTT, Template, and RESTful (many other integrations create them automatically based on a device’s characteristics).

In the distant past, you typically had to restart Home Assistant in order to reload any sensors/binary_sensors you created or modified. However, there hasn’t been a need to do that for many versions (at least not for entities based on MQTT, Template, Filter, and History Stats integrations).

2 Likes