Barma-lej / halandroid

Worx Landroid package for Home Assistant based on Landroid Cloud by @MTrab
MIT License
112 stars 49 forks source link

Invalid config for [template] with my landroid #32

Closed djiwhy closed 2 years ago

djiwhy commented 2 years ago

Hi everybody,

I need you ... I'm having an issue when I restart HA.

I have this issue reported in logs :

Invalid config for [template]: expected dictionary for dictionary value @ data['sensors']. Got [OrderedDict([('name', 'Landroid IP'), ('unique_id', 'landroid_ip'), ('state', None), ('icon', 'mdi:ip-network')]), OrderedDict([('name', 'Landroid SN'), ('unique_id', 'landroid_sn'), ('state', '201930198601008203B0'), ('icon', 'mdi:numeric')]), OrderedDict([('name', 'Landroid MAC'), ('unique_id', 'landroid_mac'), ('state', '98:D8:63:46:1C:36'), ('icon', 'mdi:barcode')]), OrderedDict([('name', 'Landroid Bladetime'), ('unique_id', 'landroid_bladetime'), ('state', "{{ state_attr('sensor.landroi.... (See /config/packages/landroid.yaml, line 66).

With this issue, i cannot see any blade time, id, s/n, tilt, pan and many other informations. But I can see batery level, landroid version, state (idle, mowing, ...) and errors.

I precise that I've the original landroid.yaml file. I haven't change anything in this file. Landroid repo installed with HACS, on HA core-2021.10.6 on a Docker container on my DS918+ Synology NAS running Python 3.9.7

Do someone have an idea ?

Sorry for the poor english i'm using cause I'm French =)

Barma-lej commented 2 years ago

Can you update package? What is Landroid's name in Landroid app?

djiwhy commented 2 years ago

Thx for the reply,

You talk about your package or landroid cloud package ?

My mower is called "mower" without brackets in the landroid app, like landroid cloud integration asks.

Is the fact that my mower isn't on the same network than my hass important ?

My hass server (on synology) is in my house. But my landroid mower is in a secondary house.

Barma-lej commented 2 years ago

You talk about your package or landroid cloud package ?

Both

Is the fact that my mower isn't on the same network than my hass important ?

It is not important

Exists these lines in your configuration.yaml?

homeassistant:
  packages: !include_dir_named packages
djiwhy commented 2 years ago

Hi Barma-lej,

I've updated both packages, landroid cloud and halandroid as you said before.

I have in configuration.yaml

Include packages dir in HA (for Halandroid card)

homeassistant: packages: !include_dir_named packages

LandroidCloud connection infos

landroid_cloud:

With these, landroid_cloud works perfectly.

In secrets.yaml

Halandroid connection infos

mower_mail: mymail@here.com mower_pass: mypasswordhere mower_ip :

I renamed landroid_mail by mower_mail to avoid an error : error in config/configuration.yaml secrets landroid_mail not defined.

I have the 2 dirs 'www' and 'packages' with originals files from your Git.

I created a manual card with cutting/paste according to the card you've created.

And I see this in my logs :

Invalid config for [template]: template value is None for dictionary value @ data['sensor'][0]['state']. Got None. (See /config/packages/landroid.yaml, line 248).

And in my Landroid card : card

djiwhy commented 2 years ago

landroidattributes

Barma-lej commented 2 years ago

Does the second line start with two spaces?

homeassistant:
  packages: !include_dir_named packages
djiwhy commented 2 years ago

sure !

homeassistant:
  packages: !include_dir_named packages

with 2 spaces

Barma-lej commented 2 years ago

Replace this

mower_mail: mymail@here.com
mower_pass: mypasswordhere
mower_ip :

with this:

mower_mail: mymail@here.com
mower_pass: mypasswordhere
mower_ip: ""

Space between mower_ip and : And empty value is not allowed

djiwhy commented 2 years ago

OMG !!!

It works like a charm.

Only for this F0ckn' brackets !

Thanks a lot. You're my new hero. Thank you for the time you spent developping this and the time helping me. 🥇

Barma-lej commented 2 years ago

You are welcome :)

djiwhy commented 2 years ago

I will love this card.

Closed ;)

macnug commented 2 years ago

Hi everyone, i have the same behaviour. I don't have the secrets.yaml so i added to /config/packages/landroid.yaml:

mower_mail: mymail mower_pass: mypassw mower_ip: ""

"192.168.1.28"

Even if i add the real ip of the mover or the brakets or nothing... i always have this error whenever i try to restart HA.

"The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: Secret mower_ip not defined"

how can i solve this issue? Thank you!!!