Skip to content

Instantly share code, notes, and snippets.

@xenos1984
Created December 28, 2019 06:45
Show Gist options
  • Save xenos1984/dd5245db4804c1b4cd48fb0495179855 to your computer and use it in GitHub Desktop.
Save xenos1984/dd5245db4804c1b4cd48fb0495179855 to your computer and use it in GitHub Desktop.
define deimos_vlc HTTPMOD http://deimos:8080/requests/status.xml 5
attr deimos_vlc userattr get01DeleteIfUnmatched get01Encode get01Name get01TextArg:0,1 get01URL get01XPath-Strict getHeader1 reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06DeleteIfUnmatched reading06Encode reading06Name reading06XPath-Strict reading07DeleteIfUnmatched reading07Encode reading07Name reading07XPath-Strict replacement01Regex requestHeader1 set01Name set01NoArg:0,1 set01Replacement01Value set02Name set02NoArg:0,1 set02Replacement01Value set03Name set03NoArg:0,1 set03Replacement01Value set04Name set04NoArg:0,1 set04Replacement01Value set05Name set05URL set06Name set06TextArg:0,1 set06URL setHeader1 setURL
attr deimos_vlc devStateIcon stopped:audio_stop@red playing:audio_play@green paused:audio_pause@yellow
attr deimos_vlc disable 0
attr deimos_vlc get01DeleteIfUnmatched 1
attr deimos_vlc get01Encode UTF-8
attr deimos_vlc get01Name browse
attr deimos_vlc get01TextArg 1
attr deimos_vlc get01URL http://deimos:8080/requests/browse.xml?uri=$val
attr deimos_vlc get01XPath-Strict /root/element[@type="file"]/@uri
attr deimos_vlc getHeader1 Authorization: Basic XXX
attr deimos_vlc icon audio_sound
attr deimos_vlc reading01Name state
attr deimos_vlc reading01XPath-Strict /root/state/text()
attr deimos_vlc reading02Name loop
attr deimos_vlc reading02XPath-Strict /root/loop/text()
attr deimos_vlc reading03Name repeat
attr deimos_vlc reading03XPath-Strict /root/repeat/text()
attr deimos_vlc reading04Name random
attr deimos_vlc reading04XPath-Strict /root/random/text()
attr deimos_vlc reading05Name volume
attr deimos_vlc reading05XPath-Strict /root/volume/text()
attr deimos_vlc reading06DeleteIfUnmatched 1
attr deimos_vlc reading06Encode UTF-8
attr deimos_vlc reading06Name now_playing
attr deimos_vlc reading06XPath-Strict /root/information/category[@name="meta"]/info[@name="now_playing"]/text()
attr deimos_vlc reading07DeleteIfUnmatched 1
attr deimos_vlc reading07Encode UTF-8
attr deimos_vlc reading07Name title
attr deimos_vlc reading07XPath-Strict /root/information/category[@name="meta"]/info[@name="title"]/text()
attr deimos_vlc replacement01Regex %%cmd%%
attr deimos_vlc requestHeader1 Authorization: Basic XXX
attr deimos_vlc room Rooms->Main
attr deimos_vlc set01Name empty
attr deimos_vlc set01NoArg 1
attr deimos_vlc set01Replacement01Value pl_empty
attr deimos_vlc set02Name loop
attr deimos_vlc set02NoArg 1
attr deimos_vlc set02Replacement01Value pl_loop
attr deimos_vlc set03Name repeat
attr deimos_vlc set03NoArg 1
attr deimos_vlc set03Replacement01Value pl_repeat
attr deimos_vlc set04Name random
attr deimos_vlc set04NoArg 1
attr deimos_vlc set04Replacement01Value pl_random
attr deimos_vlc set05Name volume
attr deimos_vlc set05URL http://deimos:8080/requests/status.xml?command=volume&val=$val
attr deimos_vlc set06Name play
attr deimos_vlc set06TextArg 1
attr deimos_vlc set06URL http://deimos:8080/requests/status.xml?command=in_play&input=$val
attr deimos_vlc setHeader1 Authorization: Basic XXX
attr deimos_vlc setURL http://deimos:8080/requests/status.xml?command=%%cmd%%
define weather_ds Weather API=DarkSkyAPI,cachemaxage:600 apikey=XXX interval=3600 lang=en
attr weather_ds disable 0
attr weather_ds icon weather_station
attr weather_ds room Weather->Devices
attr weather_ds userReadings precipitation:precipIntensity.* {ReadingsVal("weather_ds", "precipIntensity", 0)}
define weather_emhi HTTPMOD http://www.ilmateenistus.ee/ilma_andmed/xml/observations.php 900
attr weather_emhi userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06Name reading06XPath-Strict reading07Name reading07XPath-Strict reading08Name reading08XPath-Strict reading09Name reading09XPath-Strict
attr weather_emhi disable 0
attr weather_emhi icon weather_station
attr weather_emhi reading01Name temperature
attr weather_emhi reading01XPath-Strict /observations/station/airtemperature[../wmocode/text()="26242"]/text()
attr weather_emhi reading02Name humidity
attr weather_emhi reading02XPath-Strict /observations/station/relativehumidity[../wmocode/text()="26242"]/text()
attr weather_emhi reading03Name pressure
attr weather_emhi reading03XPath-Strict /observations/station/airpressure[../wmocode/text()="26242"]/text()
attr weather_emhi reading04Name wind_direction
attr weather_emhi reading04XPath-Strict /observations/station/winddirection[../wmocode/text()="26242"]/text()
attr weather_emhi reading05Name wind_speed_ms
attr weather_emhi reading05XPath-Strict /observations/station/windspeed[../wmocode/text()="26242"]/text()
attr weather_emhi reading06Name precipitation
attr weather_emhi reading06XPath-Strict /observations/station/precipitations[../wmocode/text()="26242"]/text()
attr weather_emhi reading07Name visibility
attr weather_emhi reading07XPath-Strict /observations/station/visibility[../wmocode/text()="26242"]/text()
attr weather_emhi reading08Name wind_gust_ms
attr weather_emhi reading08XPath-Strict /observations/station/windspeedmax[../wmocode/text()="26242"]/text()
attr weather_emhi reading09Name condition
attr weather_emhi reading09XPath-Strict /observations/station/phenomenon[../wmocode/text()="26242"]/text()
attr weather_emhi room Weather->Devices
attr weather_emhi stateFormat {sprintf("T: %.0f °C H: %.0f %% W: %.0f km/h P: %.0f hPa", ReadingsVal("weather_emhi", "temperature", 0), ReadingsVal("weather_emhi", "humidity", 0), ReadingsVal("weather_emhi", "wind_speed", 0), ReadingsVal("weather_emhi", "pressure", 0))}
attr weather_emhi userReadings wind_speed:wind_speed_ms.* {ReadingsVal("weather_emhi", "wind_speed_ms", 0) * 3.6;;},\
wind_gust:wind_gust_ms.* {ReadingsVal("weather_emhi", "wind_gust_ms", 0) * 3.6;;}
define weather_emhif HTTPMOD http://www.ilmateenistus.ee/wp-content/themes/emhi2013/meteogram.php?locationId=793&lang=en 10800
attr weather_emhif disable 0
attr weather_emhif enforceGoodReadingNames 1
attr weather_emhif extractAllJSON 1
attr weather_emhif icon weather_station
attr weather_emhif preProcessRegex s/(^callback\()|(\);;$)|@//g
attr weather_emhif room Weather->Devices
define weather_owm Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=XXX interval=3600 lang=en
attr weather_owm disable 0
attr weather_owm icon weather_station
attr weather_owm room Weather->Devices
define weather_phys HTTPMOD http://meteo.physic.ut.ee/xml/data3.php 120
attr weather_phys userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06Name reading06XPath-Strict reading07Name reading07XPath-Strict
attr weather_phys disable 0
attr weather_phys icon weather_station
attr weather_phys reading01Name temperature
attr weather_phys reading01XPath-Strict /meteodata/data[@id="temp"]/text()
attr weather_phys reading02Name humidity
attr weather_phys reading02XPath-Strict /meteodata/data[@id="humid"]/text()
attr weather_phys reading03Name pressure
attr weather_phys reading03XPath-Strict /meteodata/data[@id="baro"]/text()
attr weather_phys reading04Name wind_direction
attr weather_phys reading04XPath-Strict /meteodata/data[@id="wind_dir"]/text()
attr weather_phys reading05Name wind_speed_ms
attr weather_phys reading05XPath-Strict /meteodata/data[@id="wind_len"]/text()
attr weather_phys reading06Name precipitation
attr weather_phys reading06XPath-Strict /meteodata/data[@id="precip"]/text()
attr weather_phys reading07Name irradiation
attr weather_phys reading07XPath-Strict /meteodata/data[@id="sole"]/text()
attr weather_phys room Weather->Devices
attr weather_phys stateFormat {sprintf("T: %.0f °C H: %.0f %% W: %.0f km/h P: %.0f hPa", ReadingsVal("weather_phys", "temperature", 0), ReadingsVal("weather_phys", "humidity", 0), ReadingsVal("weather_phys", "wind_speed", 0), ReadingsVal("weather_phys", "pressure", 0))}
attr weather_phys userReadings wind_speed:wind_speed_ms.* {ReadingsVal("weather_phys", "wind_speed_ms", 0) * 3.6;;}
define weather_wttr HTTPMOD http://en.wttr.in/Tartu,Estonia?format=j1 3600
attr weather_wttr disable 0
attr weather_wttr extractAllJSON 1
attr weather_wttr icon weather_station
attr weather_wttr room Weather->Devices
attr weather_wttr stateFormat {sprintf("T: %.0f °C H: %.0f %% W: %.0f km/h P: %.0f hPa", ReadingsVal("weather_wttr", "current_condition_01_temp_C", 0), ReadingsVal("weather_wttr", "current_condition_01_humidity", 0), ReadingsVal("weather_wttr", "current_condition_01_windspeedKmph", 0), ReadingsVal("weather_wttr", "current_condition_01_pressure", 0))}
attr weather_wttr timeout 15
attr weather_wttr userReadings cloudcover:current_condition_01_cloudcover.* {ReadingsVal("weather_wttr", "current_condition_01_cloudcover", 0)},\
humidity:current_condition_01_humidity.* {ReadingsVal("weather_wttr", "current_condition_01_humidity", 0)},\
precipitation:current_condition_01_precipMM.* {ReadingsVal("weather_wttr", "current_condition_01_precipMM", 0)},\
pressure:current_condition_01_pressure.* {ReadingsVal("weather_wttr", "current_condition_01_pressure", 0)},\
temperature:current_condition_01_temp_C.* {ReadingsVal("weather_wttr", "current_condition_01_temp_C", 0)},\
uvIndex:current_condition_01_uvIndex.* {ReadingsVal("weather_wttr", "current_condition_01_uvIndex", 0)},\
visibility:current_condition_01_visibility.* {ReadingsVal("weather_wttr", "current_condition_01_visibility", 0)},\
wind_speed:current_condition_01_windspeedKmph.* {ReadingsVal("weather_wttr", "current_condition_01_windspeedKmph", 0)},\
wind_direction:current_condition_01_winddirDegree.* {ReadingsVal("weather_wttr", "current_condition_01_winddirDegree", 0)},\
code:current_condition_01_weatherCode.* {ReadingsVal("weather_wttr", "current_condition_01_weatherCode", 0)},\
condition:current_condition_01_weatherDesc_01_value.* {ReadingsVal("weather_wttr", "current_condition_01_weatherDesc_01_value", 0)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment