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
/// <summary> | |
/// Sends an image to Form Recognizer and returns back the URL that contains the result | |
/// </summary> | |
/// <returns></returns> | |
private async Task<string> StartAnalyzingImage() | |
{ | |
var queryString = HttpUtility.ParseQueryString(string.Empty); | |
var client = _httpClientFactory.CreateClient(); |
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": "dc813b26.76fc98", | |
"type": "subflow", | |
"name": "Identify office person", | |
"info": "", | |
"category": "", | |
"in": [{ | |
"x": 20, | |
"y": 160, | |
"wires": [{ |
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":"b6e164fe.1d31e8","type":"subflow","name":"Galaxy S9 notification","info":"","category":"","in":[{"x":100,"y":80,"wires":[{"id":"af896d84.97285"}]}],"out":[{"x":600,"y":80,"wires":[{"id":"fe75d18.e659d3","port":0}]}],"env":[{"name":"message","type":"str","value":""},{"name":"title","type":"str","value":""}],"color":"#A5C13D","icon":"font-awesome/fa-mobile-phone"},{"id":"fe75d18.e659d3","type":"api-call-service","z":"b6e164fe.1d31e8","name":"Send notification","server":"8501408e.93b69","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_galaxy_s9","entityId":"","data":"msg.data","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":430,"y":80,"wires":[[]]},{"id":"af896d84.97285","type":"function","z":"b6e164fe.1d31e8","name":"","func":"var message = env.get(\"message\") || msg.message || global.get('GalaxyS9Message');\nvar title = env.get(\"title\") || msg.title || global.get('GalaxyS9Title');\n\nmsg.data = {\n |
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
const globalHomeAssistant = global.get('homeassistant'); | |
var html = msg.payload; | |
var attributeName = "efficiency_percent"; | |
var start = html.indexOf(attributeName); | |
var attr = html.substr(start + attributeName.length + 2, 5); | |
msg = {}; | |
msg.attr = attr; | |
msg.start = start; | |
msg.productivity = parseInt(attr.replace(/\"/g, "").trim()); | |
var previousScore = parseInt(globalHomeAssistant.homeAssistant.states["sensor.productivity_score"].state); |
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
type: custom:auto-entities | |
card: | |
type: entities | |
filter: | |
include: | |
- entity_id: /last_detected/ | |
exclude: | |
- entity_id: "*0x*" | |
sort: | |
method: attribute |
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
office_position: | |
friendly_name: "Office position" | |
value_template: >- | |
{% if states.binary_sensor.chair.state == 'on' %} | |
Standing up | |
{% else %} | |
Sitting down | |
{% endif %} | |
icon_template: >- | |
{% if states.binary_sensor.chair.state == 'on' %} |
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
Get-ChildItem -include bin,obj,packages,'_ReSharper.Caches','.vs' -Force -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse -ErrorAction SilentlyContinue -Verbose} | |
# Found on StackOverflow: https://stackoverflow.com/a/42762639/1091894 |
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
type: conditional | |
conditions: | |
- entity: sensor.apartment_power_total | |
state_not: "off" | |
card: | |
type: vertical-stack | |
cards: | |
- type: custom:auto-entities | |
card: |
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
docker-compose up -d | |
aws --endpoint-url=http://localhost:4583 ssm put-parameter --name "/my-app-param-store/settings/intervalInSeconds" --type String --value "60" --overwrite --region "us-east-1" & ^ |
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
public static IWebHostBuilder CreateWebHostBuilder(string[] args) | |
{ | |
return WebHost.CreateDefaultBuilder(args) | |
.ConfigureAppConfiguration((hostingContext, builder) => | |
{ | |
var env = hostingContext.HostingEnvironment; | |
var configurationBuilder = builder.AddJsonFile("appsettings.json", true, true) | |
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, | |
reloadOnChange: true); | |
if (env.IsDevelopment()) |