Bmp280 with battery monitoring on wemos d1 mini

Hi all, this is my first post, so sorry if this is on the wrong place.
I need to make a sensor to measure temperature, humidity and pressure, and battery level.
I have done this with a Wemos d1 mini, and a BMP280 sensor. This set up is running fine with arduino code in it reporthing to thinkspek.
My issue is I’m trying to make the same using home assistant and ESPhome plugin.
I’m able to follow this link https://www.home-assistant.io/integrations/bme280/ instructions to measure data and also follow this one https://esphome.io/components/sensor/adc.html to get baterry level (voltage).
My problem arrise when I what to mix or join the code on both pages to make 1 sensor to get 4 meassurements.
My actual code is not on this PC, but will added later.

Hope some one can help me on. Or point me in some documentation on how to integrate this 2 different parts toghether.

My home assistant in running on raspberry pi 4.
Thanks in advanced.

If you are using Esphome you want this page for the BME280, not the one you linked to:

The one you linked to is for direct connection to a raspi running home assistant.

Thanks tom_l, as you say I use that for my BME280 sensor, and works ok, the problem is the integration so I can get the BMP280 readings and the analog read on A0 on same device.

You are not being very clear about what the problem is. All you have to do is add both bits of code to your ESPHome config file.