Ask Domoticz a natural language about the temperature or ask him to turn on the light in the living room.
2018.11.28
- add support "unknown ask" plase add keys 'reply_unknown' in rules.json and conf.json (see my example files)
- add support float number recognize from phrase
2018.12.04
- add webservice (run webservice.py and /POST {'text':'sample text'} to http://server:port/ask or /GET http://server.port/directask?txt=sample%20tekst. Server is localhost, default port is 8071)
- text processor
- config
- get data from Domoticz
- set data to Domoticz
- say to Google Home
- as Flask webservice
- daemon
- get text from Google Home Assistant
pip3 install pyjq
pip3 install flask
git clone https://github.com/z1mEk/voicemoticz.git
sudo chmod +x voicemoticz.py
Open the ./config/config.json file and set your Domoticz API url.
Open the ./config/rules.json and modify data for your preference and your Domoticz. Keys 'elicitation_pattern' and 'name_pattern' suported regex. You must do it carefully, keeping the logic
./voicemoticz.py "Jaka jest temperatura u Marysi?"
or
./voicemoticz.py "Ile stopni jest u Szymka w pokoju?"
or
./voicemoticz.py "Ciepło jest na dworze?"
or
./voicemoticz.py "Włącz kinkiety w salonie?"
./webservice.py
/GET http://server.port/directask?txt=sample%20tekst
or
/POST http://server.port/ask
{
'text':'sample text'
}
curl example
curl --header "Content-Type: application/json" --request POST --data '{"text":"Ile stopni jest w salonie?"}' http://192.168.1.175:8071/ask
Temperatura w pokoju Szymka wynosi 20.5℃
OK, włączam kinkiety w salonie