REST API: POST /api/states/<entity_id> - actually set device via hass.async_reproduce_states

I wish to obtain the state of an entity by calling /api/states (no problem - works great)

Then I wish to POST the same endpoint a previous/different state w same contract to the same endpoint AND have it written to the device (the docs specifically say this isn’t supported - I wish to support it).

Seems this could be implemented by replacing
homeassistant/components/api/init.py – APIEntityStateView - hass.states.async_set(
with hass.async_reproduce_states

Why do I wish to do this? #1 - Consistency, why would one be able to read something but to write it need domain knowledge?

#2 - Implementing a totally new way of doing automation - no more automation/scenes/node red - a simple state engine much like how security polices, firewall rules, more like css - a series of selectors such as time of day, occupation, modes are merged to combine scenes, and restore to prior state when a room becomes vacant for ever.

GET in current API contract
POST

I don’t have an opinion on using states to do actions on devices rather than using service calls, but for sure this goes beyond the REST API only: it’s a change of paradigm of HA itself.

I like the idea of handling automations through a series of selectors. However, I don’t think this feature, as you’ve requested it, will be implemented. Your best shot is to write an integration (custom_component) that exposes a webhook or websocket command that works the way you want. Alternately, you can create a PR and assure that it has no breaking changes. Or, you can add the extra logic into your utility to handle these tasks in the currently supported way. Home Assistant only supports a finite number of entity domains. So it is possible.