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
- name: "Energia MEW-01" | |
device_class: "energy" | |
unit_of_measurement: "kWh" | |
state_class: "total_increasing" | |
unique_id: mew_whatever | |
state: > | |
{% set energy = states('sensor.mew_01_mqtt') | float(default=-1) %} | |
{% set sens = states('sensor.mew_whatever') | float %} | |
{% if energy != -1 and sens <= energy %} | |
{{energy}} |
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 input = JSON.parse(msg.data.replace("eval(", "").replace(",],", "],").slice(0, -1)); | |
const today = new Date() | |
const data_d = today.getDay(); | |
const data_m = today.getMonth()+1; | |
const smieci = ["makulatura", "szklo", "zielone","kuchenne","resztkowe", "mix", "gabaryty" ] | |
const inputSortedByKind = input["dane"].reduce((acc, curr) => { | |
acc[curr["rodzaj"]].push(new Date(2021, +curr["data_m"]-1, +curr["data_d"])) | |
return acc | |
}, { |
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
import PgUpsertPlugin from "./PgUpsertPlugin"; | |
import PostGraphileFulltextFilterPlugin from "./PostgraphileFullTextFilterPlugin" | |
import PgSimplifyInflectorPlugin from "@graphile-contrib/pg-simplify-inflector"; | |
import ConnectionFilterPlugin from "postgraphile-plugin-connection-filter"; | |
import PgOrderByRelatedPlugin from "@graphile-contrib/pg-order-by-related"; | |
import PgOrderByMultiColumnIndexPlugin from "./PgOrderByMultiColumnIndexPlugin"; | |
import { SHAREDTOKEN, CORS_OPTIONS, FORMTOKEN, hosts, adminPayload, workerPayload } from "../config"; | |
import express from "express"; | |
import UnauthorizedError from "./UnauthorizedError"; | |
import { postgraphile, makePluginHook } from "postgraphile"; |
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
import PgUpsertPlugin from "./PgUpsertPlugin"; | |
import PostGraphileFulltextFilterPlugin from "./PostgraphileFullTextFilterPlugin" | |
import PgSimplifyInflectorPlugin from "@graphile-contrib/pg-simplify-inflector"; | |
import ConnectionFilterPlugin from "postgraphile-plugin-connection-filter"; | |
import PgOrderByRelatedPlugin from "@graphile-contrib/pg-order-by-related"; | |
import PgOrderByMultiColumnIndexPlugin from "./PgOrderByMultiColumnIndexPlugin"; | |
import { SHAREDTOKEN, CORS_OPTIONS, FORMTOKEN, hosts, adminPayload, workerPayload } from "../config"; | |
import express from "express"; | |
import UnauthorizedError from "./UnauthorizedError"; | |
import { postgraphile, makePluginHook } from "postgraphile"; |
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": "d8b80ebb.d6fee", | |
"type": "switch", | |
"z": "11f0e03c.ef0f", | |
"name": "", | |
"property": "payload", | |
"propertyType": "msg", | |
"rules": [ | |
{ |
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
Gif below |
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
esphome: | |
name: podlewanie8 | |
platform: ESP32 | |
board: mhetesp32minikit | |
wifi: | |
ssid: !secret wifi_ap | |
password: !secret wifi_pass | |
domain: !secret domain |
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
#!/bin/python3 | |
import json | |
out={} | |
filename='testfile' | |
with open(f'{filename}.txt') as fin: | |
for line in fin: | |
x = line.rstrip().split("=") | |
out[x[0]] = x[1] | |
with open(f'{filename}.json', 'w') as fp: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
curl -X POST -H "Authorization:key=$key" -H "Content-Type: application/json" -d '{ | |
"notification": { | |
"title": "This is custom title", | |
"body": "this is custom body", | |
"click_action": "https://google.com", | |
"data" : {"requireInteraction": true } | |
}, | |
"registration_ids": ["$id"], | |
}' "https://fcm.googleapis.com/fcm/send" |
NewerOlder