Weber iGrill 2 integration with Lovelace UI

Thanks for that. House maintenance day today but I should be able to give that a shot tomorrow night!

no need to thank me, you did all the work, I just combines the sensors :wink:

i am a little stuckā€¦

  • I installed all the requirements
  • got the monitor.py running

but all it shows is ā€œ2020-05-09 10:43:00,354 MainThread INFO: log_level set to: INFOā€
and nothing else after that, what do i need to do?

do i need to connect the igrill to my pi through Bluetooth setup? i tried but cant do it.
running pi3b (python 2.7.16) and igrill2

I am sure its the Bluetooth connection to the igrill, the blue light stops blinkimg when i start monitor.py, but starts blinking again soon.

OK got it goingā€¦ tried a different pi, turned bluetooth on and off, then it worked. sweet project thanks.

Seems to work a treat. Thank you!

Followed @war1000ā€™s guide, on a RPi 3B, however just doesnā€™t seem to work.

Initially getting connect/disconnects on the MQTT side of hass.io, so made it anonymous. That seemed to solve that, however the BT LED on the iGrill2 seems to go solid for a bit, then flashing.
Canā€™t get my head around why itā€™s not staying connected to the Pi
./monitor.py -l debug stops at ā€œSending key of all 0ā€™sā€ - could that be an issue?

Have cleared the iGrill from my phone BT.

Tried the suggestions at https://github.com/bendikwa/igrill#troubleshooting, AutoEnable was already true, and the second line wasnā€™t there in /lib/udev/rules.d/90-pi-bluetooth.rules.
.
Thoughts?

EDIT:
Started again from scratch, gave it its own MQTT username/password. Now get this on Mosquitto:

1589791583: New client connected from 192.168.1.106 as auto-756F5485-8508-428A-1776-0495E170165A (p2, c1, k40, u'igrillbridge').
1589791607: New connection from 192.168.1.106 on port 1883.
1589791607: New client connected from 192.168.1.106 as auto-221EEAE6-7ABA-6B55-1799-ADE2FCE35F6C (p2, c1, k40, u'igrillbridge').
1589791644: Client auto-756F5485-8508-428A-1776-0495E170165A has exceeded timeout, disconnecting.

from ./monitor.py -l debug:

pi@raspberrypi:~/igrill $ ./monitor.py -l debug
2020-05-18 09:50:21,673 MainThread INFO: log_level set to: debug
2020-05-18 09:50:21,673 MainThread DEBUG: initialized with source=., defaultdata={'mqtt': {'host': 'localhost'}}
2020-05-18 09:50:21,675 MainThread DEBUG: Reading ./device.yaml, ./mqtt.yaml
2020-05-18 09:50:21,686 MainThread DEBUG: YAML LOAD: {'devices': [{'topic': 'bbq', 'interval': 20, 'type': 'igrill_v2', 'name': 'igrill', 'address': '70:91:8F:0D:B8:CF'}]}
2020-05-18 09:50:21,696 MainThread DEBUG: YAML LOAD: {'mqtt': {'host': 'droperidol', 'port': 1883, 'auth': {'username': 'igrillbridge', 'password': 'xxxx'}, 'keepalive': 40}}
2020-05-18 09:50:21,697 MainThread DEBUG: Validating dict {'mqtt': {'host': 'droperidol', 'port': 1883, 'auth': {'username': 'igrillbridge', 'password': 'xxxx'}, 'keepalive': 40}, 'devices': [{'topic': 'bbq', 'interval': 20, 'type': 'igrill_v2', 'name': 'igrill', 'address': '70:91:8F:0D:B8:CF'}]} with specs: {'required_entries': {'mqtt': <type 'dict'>, 'devices': <type 'list'>}}
2020-05-18 09:50:21,698 MainThread DEBUG: Validating dict {'host': 'droperidol', 'port': 1883, 'auth': {'username': 'igrillbridge', 'password': 'xxxx'}, 'keepalive': 40} with specs: {'optional_entries': {'tls': <type 'dict'>, 'port': <type 'int'>, 'auth': <type 'dict'>, 'keepalive': <type 'int'>}, 'required_entries': {'host': <type 'str'>}}
2020-05-18 09:50:21,698 MainThread DEBUG: Validating dict {'username': 'igrillbridge', 'password': 'xxxx'} with specs: {'optional_entries': {'password': <type 'str'>}, 'required_entries': {'username': <type 'str'>}}
2020-05-18 09:50:21,698 MainThread DEBUG: Validating list [{'topic': 'bbq', 'interval': 20, 'type': 'igrill_v2', 'name': 'igrill', 'address': '70:91:8F:0D:B8:CF'}] with specs: {'specs': {'list_type': <type 'dict'>, 'optional_entries': {'publish_missing_probes': <type 'bool'>, 'missing_probe_value': <type 'str'>}, 'required_entries': {'topic': <type 'str'>, 'interval': <type 'int'>, 'type': <type 'str'>, 'name': <type 'str'>, 'address': <type 'str'>}}}
2020-05-18 09:50:21,699 MainThread DEBUG: Validating dict {'topic': 'bbq', 'interval': 20, 'type': 'igrill_v2', 'name': 'igrill', 'address': '70:91:8F:0D:B8:CF'} with specs: {'list_type': <type 'dict'>, 'optional_entries': {'publish_missing_probes': <type 'bool'>, 'missing_probe_value': <type 'str'>}, 'required_entries': {'topic': <type 'str'>, 'interval': <type 'int'>, 'type': <type 'str'>, 'name': <type 'str'>, 'address': <type 'str'>}}
2020-05-18 09:50:21,734 igrill DEBUG: Device thread igrill (re)started, trying to connect to iGrill with address: 70:91:8F:0D:B8:CF
2020-05-18 09:50:21,735 igrill DEBUG: Created new device with name igrill
2020-05-18 09:50:21,735 igrill DEBUG: Trying to connect to the device with address 70:91:8F:0D:B8:CF
2020-05-18 09:50:21,736 igrill DEBUG: Calling btle.Peripheral.__init__ with lock: 1993315584
2020-05-18 09:50:21,747 igrill DEBUG: Failed to connect to peripheral 70:91:8F:0D:B8:CF, addr type: public
2020-05-18 09:50:21,747 igrill DEBUG: Sleeping for 20 seconds before retrying
2020-05-18 09:50:41,768 igrill DEBUG: Device thread igrill (re)started, trying to connect to iGrill with address: 70:91:8F:0D:B8:CF
2020-05-18 09:50:41,769 igrill DEBUG: Created new device with name igrill
2020-05-18 09:50:41,769 igrill DEBUG: Trying to connect to the device with address 70:91:8F:0D:B8:CF
2020-05-18 09:50:41,770 igrill DEBUG: Calling btle.Peripheral.__init__ with lock: 1993315584
2020-05-18 09:50:41,790 igrill DEBUG: Failed to connect to peripheral 70:91:8F:0D:B8:CF, addr type: public
2020-05-18 09:50:41,791 igrill DEBUG: Sleeping for 20 seconds before retrying
2020-05-18 09:51:01,812 igrill DEBUG: Device thread igrill (re)started, trying to connect to iGrill with address: 70:91:8F:0D:B8:CF
2020-05-18 09:51:01,813 igrill DEBUG: Created new device with name igrill
2020-05-18 09:51:01,813 igrill DEBUG: Trying to connect to the device with address 70:91:8F:0D:B8:CF
2020-05-18 09:51:01,814 igrill DEBUG: Calling btle.Peripheral.__init__ with lock: 1993315584
2020-05-18 09:51:01,834 igrill DEBUG: Failed to connect to peripheral 70:91:8F:0D:B8:CF, addr type: public
2020-05-18 09:51:01,835 igrill DEBUG: Sleeping for 20 seconds before retrying

then suddenly:

2020-05-18 09:56:42,507 igrill DEBUG: Device thread igrill (re)started, trying to connect to iGrill with address: 70:91:8F:0D:B8:CF
2020-05-18 09:56:42,508 igrill DEBUG: Created new device with name igrill
2020-05-18 09:56:42,508 igrill DEBUG: Trying to connect to the device with address 70:91:8F:0D:B8:CF
2020-05-18 09:56:42,509 igrill DEBUG: Calling btle.Peripheral.__init__ with lock: 1993315584
2020-05-18 09:56:42,814 igrill DEBUG: Releasing lock: 1993315584
2020-05-18 09:56:45,148 igrill DEBUG: Authenticating...
2020-05-18 09:56:45,149 igrill DEBUG: Sending key of all 0's
2020-05-18 09:56:45,480 igrill DEBUG: Authenticated
2020-05-18 09:56:45,483 igrill DEBUG: Added probe with index 1, name PROBE1_TEMPERATURE, and UUID Characteristic <06ef0002-2e06-4b79-9e33-fce2c42805ec>
2020-05-18 09:56:45,485 igrill DEBUG: Added probe with index 2, name PROBE2_TEMPERATURE, and UUID Characteristic <06ef0004-2e06-4b79-9e33-fce2c42805ec>
2020-05-18 09:56:45,487 igrill DEBUG: Added probe with index 3, name PROBE3_TEMPERATURE, and UUID Characteristic <06ef0006-2e06-4b79-9e33-fce2c42805ec>
2020-05-18 09:56:45,489 igrill DEBUG: Added probe with index 4, name PROBE4_TEMPERATURE, and UUID Characteristic <06ef0008-2e06-4b79-9e33-fce2c42805ec>
2020-05-18 09:56:46,507 igrill DEBUG: Published temp: {1: 24.0, 2: False, 3: False, 4: False} and battery: 59.0 to topic bbq/igrill
2020-05-18 09:56:46,507 igrill DEBUG: Sleeping for 20 seconds
2020-05-18 09:57:06,530 igrill DEBUG: Device disconnected
2020-05-18 09:57:06,531 igrill DEBUG: Sleeping for 20 seconds before retrying
2020-05-18 09:57:26,552 igrill DEBUG: Device thread igrill (re)started, trying to connect to iGrill with address: 70:91:8F:0D:B8:CF
2020-05-18 09:57:26,553 igrill DEBUG: Created new device with name igrill
2020-05-18 09:57:26,553 igrill DEBUG: Trying to connect to the device with address 70:91:8F:0D:B8:CF
2020-05-18 09:57:26,554 igrill DEBUG: Calling btle.Peripheral.__init__ with lock: 1993315584
2020-05-18 09:57:26,825 igrill DEBUG: Releasing lock: 1993315584
2020-05-18 09:57:27,155 igrill DEBUG: Device disconnected
2020-05-18 09:57:27,155 igrill DEBUG: Sleeping for 20 seconds before retrying

But it stopped again, and went back to disconnected/sleeping loop.

Tried it with a fresh SD card of Raspbian (not Lite) - pairing via the desktop just times out, but the blue light on the iGrill2 goes solid.

So the line in the troubleshooting section is:
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/bin/hciconfig %k up"
whereas mine was:
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bthelper@%k.service"

Commented it out anyway and it seems to be working now, after a few restarts of the Pi and the iGrill2!

Has anyone else passed sensor values through to Google Assistant?

Iā€™ve rebuilt a few times and even ordered a new pi zero. Is anyone successfully running this on a zero w?

I plan to give it another crack, as the BT range on my iGrill is less than I need, so would love to get it working with HA.

Iā€™m going to test this on the weekend, can give you some feedback on my progress if you like.

Hi,

I have managed to install the Igrill integration on new dedicated Pizero with monitor.py running continuously. Seems to be working very stable. As soon as I power on my Igrill2 its reconnected to Pizero via BT and starts to pass on values via wifi/mqtt to my HA running on a PI-4, even when the Igrill2 may have been offline for a week or so.

Just trying to figure out a good way to monitor that the pizero is in a good health - I have considered glances but seems to be quite cpu intensive on a pi-zero.

I just installed it on a Pi Zero W. Hereā€™s a quick quide how I did it:

Install required packages:

sudo apt-get update && upgrade
sudo apt install git python3-pip

Clone Repo:

git clone https://github.com/bendikwa/igrill.git

Install iGrill Requirements:

pip3 install -r igrill/requirements.txt

Create config dir:

mkdir igrill/config

Create MQTT config file:

nano igrill/config/mqtt.yaml

Add the following:

mqtt:
  host: ip-of-mqtt-server
  port: 1883
  keepalive: 60
  auth:
    username: 'username'
    password: 'password'

Turn on the iGrill device and get the MAC address with:

sudo hcitool lescan

Create Device config file:

nano igrill/config/device.yaml

Add the following:

devices:
  - name: 'Kugelgrill'
    type: 'igrill_v2'
    address: 'AB:12:CD:34:EF:56'
    topic: 'temperatur/grill'
    interval: 20

Start app:

igrill/monitor.py -c igrill/config

You should now see the values getting published to the topic ā€˜temperatur/grillā€™.

To continually run the app as a service in the background, create a file called igrill.service:

sudo nano /etc/systemd/system/igrill.service

Add the following content:

[Unit]
Description=igrill MQTT service
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=2
User=pi
ExecStart=/usr/bin/python /home/pi/igrill/monitor.py -c /home/pi/igrill/config

[Install]
WantedBy=multi-user.target

Test the service:

sudo systemctl start igrill
sudo systemctl status igrill

Restart the service:

sudo systemctl stop igrill
sudo systemctl restart igrill

Enable service to run on boot:

sudo systemctl enable igrill
sudo reboot now

I get the following error when trying to run the igrill app:

pi@raspberrypi:~ $ igrill/monitor.py -c igrill/config
Traceback (most recent call last):
  File "igrill/monitor.py", line 8, in <module>
    from config import Config
  File "/home/pi/igrill/config.py", line 1, in <module>
    from builtins import object
ImportError: No module named builtins

did you install the requirements?
What does pip3 list show?

$ pip3 list
Package       Version  
------------- ---------
asn1crypto    0.24.0   
bluepy        1.3.0    
certifi       2018.8.24
chardet       3.0.4    
cryptography  2.6.1    
entrypoints   0.3      
future        0.17.1   
idna          2.6      
keyring       17.1.1   
keyrings.alt  3.1.1    
paho-mqtt     1.4.0    
pip           18.1     
pycrypto      2.6.1    
PyGObject     3.30.4   
python-apt    1.8.4.1  
pyxdg         0.25     
PyYAML        5.1.2    
requests      2.21.0   
SecretStorage 2.3.1    
setuptools    40.8.0   
six           1.12.0   
ssh-import-id 5.7      
urllib3       1.24.1   
wheel         0.32.3   
yamlreader    3.0.4   

I also notice when looking further up into the install of the requirements text, the following error. Have several:

The scripts futurize and pasteurize are installed in ā€˜/home/pi/.local/binā€™ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

What do you get when you enter python --version? It should be something with 3.xx

I have rasperry pi running hassos. I would like to have this running on the same device. What is the best way to get this running?

Itā€™s showing version 2.7.6??

Iā€™m going to start over again and make sure I use pip3 for everything.

Thatā€™s why itā€™s not working, itā€™s using the wrong python version. No need to start over.

This command should fix it.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

That seems to work! Thank you. Now I just need to figure out how to get the MQTT readings, as theyā€™re not showing up. Is my formatting of my mqtt.yaml correct?

mqtt:
  host: 192....
  port: 1883
  keepalive: 60
  auth:
    username: 'igrill'
    password: 'XxXxXxXx'

Your formatting is correct.
Do you have a user ā€˜igrillā€™ configured in your mqtt broker?
By the way, you donā€™t need to hide this ip-address as it is a local ip address, no one can get access to your network through this