3 ms·
Did one single test with phind.com. It literally just copy-pasted me code from the top result blog it found on the sidebar - and it didn't solve my question in
by theshrike79 4y ago
Did one single test with phind.com.
It literally just copy-pasted me code from the top result blog it found on the sidebar - and it didn't solve my question in the least.
GPT-4 on the other hand was correct on the first try.
The question was about controlling Home Assistant remotely with Python. Phind's solution included RedisMQ just because the blogger had set up one as their home automation main bus. [0]
GPT-4 just gave me the code how to use the official homeassistant python package to control entities.
The correct code is literally 3 lines:
from homeassistant.remote import API
api = API('http://localhost:8123', '<api_token>')
api.services('light', 'turn_on', {'entity_id': 'light.kitchen'})
[0] https://www.phind.com/search?q=how+can+I+control+lights+on+home+assistant+using+an+external+python+program&c=&source=searchbox&init=true https://www.phind.com/search?q=how+can+I+control+lights+on+h...