-
Notifications
You must be signed in to change notification settings - Fork 58
Create and set a sensor #426
Unanswered
noname9312
asked this question in
Q&A
-
Im trying to create a new sensor and set the data. Unfortunatly I cant figure it out and cant find any examples.
Here is the code of what I want to achieve:
(sensor.mysensor doesnt exists yet)
import requests
import json
import time
def update_sensor():
# scraping website and filling data
data = "dummy content"
state.setattr("sensor.mysensor", data)
while True:
time.sleep(600)
update_sensor()
This is only one of many different tries.
Could someone please help me?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment