State of yeelight is not inline between Yeelight app and HA

Hello,

Im starting to use recently HA to control my homeautomation and my yeelight lamps so Im new to this.
I noticed the below 2 points:

  1. when cutting the power on the lamp the status is not set to Unavailable in the Home Assistant(I need to restart the server to make it updated)

  2. the yeelight state (ON/OFF) is not inline between the yeelight app and the HA
    I turned off the lamp from the app and check the overview in HA however the state is always on.
    When I tried to turn it OFF then ON from HA I got a core
    more config/core.py
    “”“Component to interact with Hassbian tools.”""
    import asyncio

from homeassistant.components.http import HomeAssistantView
from homeassistant.config import async_check_ha_config_file

@asyncio.coroutine
def async_setup(hass):
“”“Set up the Hassbian config.”""
hass.http.register_view(CheckConfigView)
return True

class CheckConfigView(HomeAssistantView):
“”“Hassbian packages endpoint.”""

url = '/api/config/core/check_config'
name = 'api:config:core:check_config'

@asyncio.coroutine
def post(self, request):
    """Validate configuration and return results."""
    errors = yield from async_check_ha_config_file(request.app['hass'])

    state = 'invalid' if errors else 'valid'

    return self.json({
        "result": state,
        "errors": errors,
    })

Could you please advise ?

Thanks in advance