pascal-parent / esphome

My collection of ESPHome YAML scripts
Creative Commons Zero v1.0 Universal
9 stars 1 forks source link

rp2040 uf2 file converted from yaml #1

Closed deon-dup closed 9 months ago

deon-dup commented 10 months ago

Trying to get ESPHome working on RP2040W, but I'm not even getting to start using your code to try out the Kitchen display. The simple and standard yaml, is where my issue start. So downloaded the manual way, but of course it is in yaml, which need to be converted to UF2, and dropped on the RPI-RP2 folder from USB drive. I do apologise for a really Noob question, but any advice?

I tried the process in this link, but then get stuck with MD5Builder.h dependency. I however don't know if I'm even at the right place.

https://www.jeffgeerling.com/blog/2022/esphome-on-raspberry-pi-pico

pascal-parent commented 10 months ago

Hi Deon-dup, I will assume that you used the "esphome-pico-energy-display.yaml" file. I would advise you to start with a stripped down version by taking all the homeassistant, display, font and color out. This would leave you with some basic sensors, which is my usual strating point. Then use install and download the UF2 built by ESPHome and copy it to your RP2040W, remember to press the boot button when powering up the RP2040W before uploading the UF2. After that you should be able to see the debug information, you can work from there. By the way, I am doing some tutorials on Youtube if you are interested, the installation and basic testing of ESPHome is for Friday. https://www.youtube.com/channel/UCeiWwT0ZweB4Oy_vAOPZ3lQ I will also be transfering all new transfering all future code over there and achiving this one. I hope this will help, I may add the RP2040W to the demo given it does not extend the tutorial's time too much.

deon-dup commented 10 months ago

Hi Pascal

Yes I used a stripped down version. The mistake I made, was to 'Download' the config from the main device screen. This downloads a yaml file, not UF2. What one should do, and hence my mistake, is to choose 'Install' and then manual download. The system will then generate a UF2, which you can download. You can then drag that file to the USB RPI-RP2. All works fine now. I will now proceed to try out some of your brilliant code - thank you !

Looking forward to your tutorial on Friday !

deon-dup commented 9 months ago

Hi Pascal,

Sorry me again. Right so I have amended your Kitchen code, and it works, but doesn't display proper data, and clearly has some errors. What I've picked up in the log files is a font error, and some other.

I have a Pico-Res Touch-LCD-2.8 (320x240 pixels), with XPT2046 Touch (like your code).

I see an issue with font:129. Have dowloaded materialdesignicons-webfont.ttf and placed in folder as per your instructions.

See log file, jpg of screen. Any guidance would be appreciated.

Pico Display logs_rp2040w_logs-2.txt

pascal-parent commented 9 months ago

Hi Deon-dup,

The font error is with the 2 blocks next to the clock, I have not fixed mine yet. As for the data not showing up, you need to map your Home Assistant entities to the ESPHome device

Example:

- platform: homeassistant
    id: weather_forcast_min_temp
    entity_id: sensor.weather_forcast_min_temp <= this would be the HA Entity from your weather integration
    internal: True

- platform: homeassistant
    name: "Solar"
    id: solar_power
    entity_id: sensor.sunsynk_pv1_power <= this would be the HA Entity from your invertor
    unit_of_measurement: W
    internal: True

I hope that makes sense.

deon-dup commented 9 months ago

Hi Pascal

Thanks for your prompt response. I didnt want to bug you with my full yaml file, but in essence I've done the full mapping of all entities as per my own config (also open weather, WernerHA, and the Solar Assistant).

So question though: Does the info mean a mapping problem? Also I assume I just use my sensors in HA, in ESPHome as per your example, i.e. ESPHome knows all the sensor data in HA?

pascal-parent commented 9 months ago

As far as I understand it, if you are using HAOS the mapping technique shown above should work. One thing though, can you see the ESP in HA? If not, it may be that your Home assistant cannot connect to it, or vice versa Check your HA API or manually connect it using its IP address, it wont work until then.

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_encryption_key

Either way, my bet is it's not connected to HA.

I cover this in this weekend's upcoming tutorial.

deon-dup commented 9 months ago

Perfect, yes I see the ESP in HA, and also do the Config, validation and Installation from HA.

As a side note, it’s a pity rp2024 does not have MQTT supported or Web support yet.

homeautomatorza commented 9 months ago

MQTT would be great! The web one, I saw something about the port recently so, if my memory serves me, it could be in the pipeline.