Skip to content

Instantly share code, notes, and snippets.

@and7ey
and7ey / vkusvill.py
Last active October 9, 2024 11:56
Home Assistant - Pyscript - Modify input_boolean entity when there is an active (in delivery) VkusVill order
"""
service: pyscript.vkusvill_get_orders
data:
token: <YOUR-TOKEN>
number: '<YOUR-CARD-NUMBER>'
var: 'input_boolean.vkusvill_delivery_in_progress'
"""
import aiohttp
import json
@and7ey
and7ey / HA_Theme_Changer.js
Created September 11, 2024 15:56
Home Assistant Theme Changer - TamperMonkey script
// ==UserScript==
// @name Home Assistant Theme Changer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Changes HTML tag based on minute value
// @match http://192.168.1.110:8123/*
// @grant none
// ==/UserScript==
(function() {
@and7ey
and7ey / level-travel-trip-advisor.js
Created July 21, 2024 16:09
Добавление рейтинга отеля с TripAdvisor в результаты поиска Level Travel (скрипт для Tampermonkey)
// ==UserScript==
// @name Level Travel + Trip Advisor
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Enhance Level Travel site with TripAdvisor ratings
// @author You
// @match https://level.travel/search/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@and7ey
and7ey / hamster.js
Last active July 23, 2024 16:03
Tampermonkey Chrome script to display best upgrades in Hamster Kombat
// ==UserScript==
// @name HamsterKombat Upgrades
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Optimize upgrades based on profit/hour delta to price ratio
// @author You
// @match https://hamsterkombat.io/clicker/mine*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@and7ey
and7ey / oico.py
Last active May 18, 2024 08:38
Home Assistant pyscript to get data from OICO / Etalok UK
"""
service: pyscript.oico_get_counters
data:
address_id: 310379
counters:
- counter_id: 123456 # электроэнергия
mqtt_topic1: 'oico/energy-meter/t1'
mqtt_topic2: 'oico/energy-meter/t2'
mqtt_topic3: 'oico/energy-meter/t3'
- counter_id: 7890123 # отопление
@and7ey
and7ey / keenetic.py
Created May 18, 2024 08:35
Home assistant pyscript for Keenetic
"""
The script allows to modify internet availability schedule for particular device connected to Keenetic router.
Script to be used with Pyscript HACS custom integration (https://github.com/custom-components/pyscript).
The following configuration is required (at configuration.yaml):
pyscript:
allow_all_imports: true
apps:
keenetic:
@and7ey
and7ey / Pocketmine.sublime-build
Created May 16, 2024 19:00
Sublime Build to upload Pocketmine plugins and start the server
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["plugin.yml"],
"quiet": true,
// "syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Pack & upload plugin",
"shell_cmd": "/Users/andrey/Documents/Dev/Other/MinecraftPMMP/packPlugin.command $folder"
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: YC Log
file_extensions: [log]
scope: source.example-c
contexts:
main:
# Request identifiers
- match: '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (START|END|REPORT) RequestID: .*'
// https://developers.home-assistant.io/docs/api/rest
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["manifest.json"],
"quiet": true,
"syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Restart Server",
@and7ey
and7ey / Home Assistant.sublime-build
Created May 16, 2024 14:11
Sublime Build system to test Home Assistant plugins / integrations
// https://developers.home-assistant.io/docs/api/rest
// http://www.sublimetext.com/docs/3/build_systems.html
{
"keyfiles": ["manifest.json"],
"quiet": true,
"syntax": "Packages/ShellScript/Bash.sublime-syntax",
"variants":
[
{
"name": "Restart Server",