This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"621a939e.0e87fc","type":"subflow","name":"influxdb write measurement","info":"# influxdb write measurement\n\nWrites a measurement to InfluxDB via the InfluxDB API. Note that the request body is sent to the API in plain-text format so plan accordingly.\n\n### Important note about string fields\n\nAs the request body is sent to the API in plain-text format, it is up to you to ensure that your string field values are properly escaped by surrounding them with quotes at the beginning and end of the string value.\n\nFor example, you might have a string value of `\"world\"`. To properly excape the string, you would need to update its value to `\"\\\"world\\\"\"`;","category":"storage","in":[{"x":40,"y":40,"wires":[{"id":"e12474f4.e0b5d8"}]}],"out":[{"x":540,"y":40,"wires":[{"id":"a6367839.7d92e8","port":0}]}],"env":[{"name":"Server_Host","type":"str","value":"","ui":{"icon":"font-awesome/fa-server","label":{"en-US":"Server Host"},"type":"input","opts":{"types":["str","json","bin","env"]}}},{"name":"Database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* CREDIT: The below is a modified JS port of the Python code from claytonjn's hass-circadian_lighting repository | |
* URL : https://github.com/claytonjn/hass-circadian_lighting | |
*/ | |
// weather is expected to be a darksky weather response JSON object with at least today and tomorrow as daily forcast objects | |
// NOTE: this implementation could be made more accurate by making a Time Machine request to darksky, but this would be an | |
// additional API call and could possibly result in hitting the daily API call limit. As such, yesterday's weather is | |
// optional and can be omitted in favor of an estimation based on today's values if desired | |
function getPercent(weather, yesterdayWeather) { |