Mercurial > code > home > repos > homeauto
changeset 597:e1ee6661329a
adjust kitchen PWM freqs. add comments and proposed contents of n3 configs
Ignore-this: 8fc4659c1d8830e1ed66b0702b1e69fd
author | drewp@bigasterisk.com |
---|---|
date | Sat, 13 Jul 2019 19:58:50 -0700 |
parents | a56bc73d308c |
children | c7cdde15e8f0 |
files | service/mqtt_graph_bridge/config.n3 service/mqtt_graph_bridge/config_cardreader.n3 service/mqtt_graph_bridge/h801/config_counter.yaml service/mqtt_graph_bridge/h801/config_skylight.yaml service/mqtt_graph_bridge/mqtt_graph_bridge.py |
diffstat | 5 files changed, 85 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/mqtt_graph_bridge/config.n3 Sat Jul 13 19:58:50 2019 -0700 @@ -0,0 +1,54 @@ +@prefix : <http://projects.bigasterisk.com/room/> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix fr: <http://bigasterisk.com/foaf/> . + +:kitchenSkylight a :Device; + :mqttTopicHead ("h801_skylight" "light"); + :convertedAttr [ + :deviceAttr :white; + :mqttTopicTail ("kit_w1" "command"); + :valueConversion :to8Bit; + :message '{"state":"ON","brightness":%value%}' + ], + :convertedAttr [ + :deviceAttr :color; + :mqttTopicTail ("kit_r" "command"); + :valueConversion :extractRed8Bit; + :message '{"state":"ON","brightness":%value%}' + ], + :convertedAttr [ + :deviceAttr :color; + :mqttTopicTail ("kit_g" "command"); + :valueConversion :extractGreen8Bit; + :message '{"state":"ON","brightness":%value%}' + ], + :convertedAttr [ + :deviceAttr :color; + :mqttTopicTail ("kit_r" "command"); + :valueConversion :extractBlue8Bit; + :message '{"state":"ON","brightness":%value%}' + ], + +:nightlightAriTemperature a :ExportedMeasurement; + :mqttTopicHead ("nightlight_ari" "sensor" "temperature" "state"); + + :missingAfterSec 150; + :ignoreInputValueBelow -999; + + :valueProcess [ + :conversion :celsiusToFarenheit; #and round(x,2) + ]; + + :graphStatements [ + :outputPredicate :temperatureF; + :statementLifetime :untilReplaced; + + # is this just another valueProcess? + :outputRecentPredicate :recentLowTemperatureF; :recentPeriodSec 30; + ], + + :influxMeasurement [ + :measurement "temperatureF"; + :predicate :temperatureF; + :tag [:key "host"; :value "nightlight_ari"], + [:key "location"; :value "ariRoom"]] .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/mqtt_graph_bridge/config_cardreader.n3 Sat Jul 13 19:58:50 2019 -0700 @@ -0,0 +1,14 @@ +@prefix : <http://projects.bigasterisk.com/room/> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix fr: <http://bigasterisk.com/foaf/> . + +:cardReader a :MqttStatementSource; + :mqttTopicHead ("nightlight_display1" "tag"); + :valueProcess [ + :conversion :tagIdToUri # AA-BB-CC-DD to <http://bigasterisk.com/rfidCard/aabbccdd> + ]; + :graphStatements [ + :outputPredicate :currentRead; + :statementLifetime "5s"; + ] + . \ No newline at end of file
--- a/service/mqtt_graph_bridge/h801/config_counter.yaml Sun Jul 07 11:23:48 2019 -0700 +++ b/service/mqtt_graph_bridge/h801/config_counter.yaml Sat Jul 13 19:58:50 2019 -0700 @@ -1,5 +1,14 @@ substitutions: - pwm_freq: 500 Hz + pwm_freq: 310 Hz + +#310 low buzz, nicer than 520 +#520 low pitch buzz, ok +#600 sound is present but might be ok +#800 bad sound +#1500 sound is bad but we had it like that +#3000 very bad snd +#6000 bad snd and flicker +#9000 flicker esphomeyaml: name: h801_counter
--- a/service/mqtt_graph_bridge/h801/config_skylight.yaml Sun Jul 07 11:23:48 2019 -0700 +++ b/service/mqtt_graph_bridge/h801/config_skylight.yaml Sat Jul 13 19:58:50 2019 -0700 @@ -1,5 +1,5 @@ substitutions: - pwm_freq: 500 Hz + pwm_freq: 310 Hz esphomeyaml: name: h801_skylight
--- a/service/mqtt_graph_bridge/mqtt_graph_bridge.py Sun Jul 07 11:23:48 2019 -0700 +++ b/service/mqtt_graph_bridge/mqtt_graph_bridge.py Sat Jul 13 19:58:50 2019 -0700 @@ -1,3 +1,9 @@ +""" +We get output statements that are like light9's deviceAttrs (:dev1 :color "#ff0000"), +convert those to outputAttrs (:dev1 :red 255; :green 0; :blue 0) and post them to mqtt. + +This is like light9/bin/collector. +""" import json from docopt import docopt