home-assistant

python Mqtt subscribe how to delete first session/message

China☆狼群 提交于 2021-01-29 07:01:03
问题 I created a Mqtt subscribe with python that has HA as broker … when I make the first connection I start a series of messages of all the mqtt buttons that I connected even if I am not activating them because my subscription is "house/click/ # ". Once the list is done … if you press a button I start getting the messages I need … is there a way to delete this first list that it gives me. this is the code I use: import paho.mqtt.client as paho import pandas as pd import pyautogui import os import

Formating the api url to return only the videoId. (And use minimal quota)

最后都变了- 提交于 2019-11-27 08:58:12
问题 So I'm using Home Assistant to launch an automation that retrieves the newest videoId that a channel has uploaded, so I can use my google home to play it(on a Roku TV), works fine, I am working on creating an automation that also does a GET request but for now, I am using the home assistant rest sensor that updates by performing a GET after a set number of seconds, for some reason though there are only 3 sensors polled every minute or so it seems they use around 100-500 quota(hitting my quota