HASS library
For your scripts
HASS library
A module, not an app: it shows nothing by itself and adds functions that your scripts import.
- Topic
- Smarthome
- Includes
- Module
Runs on
- Runs on 32×8 (TC001 & DIY)
- Runs on 52×16 (TC002)
- Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.
Choose your display in the next step.
Is this your script?
If you created this script, open your saved edit link to add it to your account. You can then manage it whenever you sign in. Adding it to your account replaces the edit link.
Script description
# @module
# @config hass_url text "Hass URL" default="http://homeassistant.lan:8123"
# @config hass_token text "Hass token" default=""
var hass_config = module("hass_config")
hass_config.hass_url = store.get("hass_url")
hass_config.hass_token = store.get("hass_token")
import hass
import hass_config
hass.init(hass_config.hass_url, hass_config.hass_token)
def init()
hass.int(self.home_temp_entity,
end
def(value, error)
if error != nil
log("Home Assistant error: " + error)
return
end
if value == nil
log("Temperature attribute is nil")
return
end
self.temp = value
# log("Temperature: " + str(self.temp))
end
)
Sign in to view and copy the code of this script.
Discussion 0
Ask a question, suggest a change or share how you use it.
No comments yet. Start the conversation.
Have an idea?
Sign in to ask questions and join the conversation.