Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xannor authored Nov 9, 2019
1 parent 7f0a5ad commit 2a3f6d5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# hass_py_set_state
# Set State
Home Assistant Python Script to force set and entity state

## How it works
This script adds a service that lets you update the state and/or attributes of any entity, similar to the developer tools

Requires `python_script:` to be enabled in you configuration

## Installation
Copy the Python script in to your `/config/python_scripts` directory or add this repository and install via HACS.

## Service arguments
key | required | type | description
-- | -- | -- | --
`entity_id:` | True | string | The full entity id to update
`state:` | False | any | The state value
`allow_create:` | False | Boolean | Allow the entity to be created if it does not exists (Defaults to false so mis-typed entities do not accidentally get created.)
`...:` | False | any | any additional name becomes or replaces and attribute on the entity

## Usage
Each call requires at least an entity_id and a state or attributes (otherwise it wont do anything)

example:

```
entity_id: sensor.random_sensor
state: 0
allow_create: true
```

(Thanks to [@rodpayne](https://community.home-assistant.io/u/rodpayne) for the initial script:
(https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975)

0 comments on commit 2a3f6d5

Please sign in to comment.