nielsfaber / scheduler-card

HA Lovelace card for control of scheduler entities
GNU General Public License v3.0
869 stars 111 forks source link

Card not found after upgrading to v2.1.0 #374

Closed kaizersoje closed 3 years ago

kaizersoje commented 3 years ago

I get an error that the card is not found after upgrading to v 2.1.0.

I downgraded back to v 2.0.5 and the card is found again. I am currently on HA 2021.4.6

nielsfaber commented 3 years ago

Are you using HACS? If so, can you check in your config folder whether www/community/scheduler-card/scheduler-card.js exists? Also, is anything printed in the browser logs?

kaizersoje commented 3 years ago

Yes, I am using HACS. After upgrading, the scheduler-card.js disappeared and there was only a zip file in the folder.

gtjadsonsantos commented 3 years ago

try clear cache in the browser and reload page

balbulator commented 3 years ago

I have the same problem, after the update, the map disappeared in the Lovelace view

balbulator commented 3 years ago

Nothing has changed in the config file - url: /hacsfiles/scheduler-card/scheduler-card.js type: module the file in the folder is also present config\www\community\scheduler-card I cleaned the cache, it does not help

balbulator commented 3 years ago

Rollback to version 2.0.5 helped, everything returned

nielsfaber commented 3 years ago

@kaizersoje

Yes, I am using HACS. After upgrading, the scheduler-card.js disappeared and there was only a zip file in the folder.

This is strange. HACS should unpack the zip and place the .js file there. If that doesn't happen, you could manually unpack it and refresh the frontend (Click "Reload resources"): image

nielsfaber commented 3 years ago

Could you try updating to v2.1.1? It contains some bug fixes introduced by the v2.1.0, none of which are actually related to this, but perhaps it was an issue with the last release.

balbulator commented 3 years ago

2.1.1 - all right, thank you

balbulator commented 3 years ago

Sorry, but the problem with the missing image remained in versions 2.1.0 and 2.1.1 Works fine only in 2.0.5

balbulator commented 3 years ago

Without rebooting the home assistant, version 2.1.1 is working, I'm afraid to reboot, the last time after rebooting the card disappeared

balbulator commented 3 years ago

In the last two versions, after a reboot, the card disappears, so far nothing helps, a rollback coma to 2.0.5

nielsfaber commented 3 years ago

Seems like you have a different issue than others. Maybe it is due some schedule you have configured. You could help me by checking the browser logs when it occurs. See here on how to access them for your browser: https://zapier.com/help/troubleshoot/behavior/view-and-save-your-browser-console-logs Please post the results here.

balbulator commented 3 years ago

Hooray, everything worked out, I just updated the HACS and everything was fine, now the card does not disappear after a reboot. Thank you for your willingness to help, the issue is closed.

nielsfaber commented 3 years ago

@kaizersoje Any updates on the status of this issue? Im not sure how I can help. I don’t have clues so far that it’s actually in the code.

balbulator commented 3 years ago

everything repeated again - no map now I will try to see the logs

balbulator commented 3 years ago
Uncaught (in promise) TypeError: Cannot read property 'some' of undefined
    at s (scheduler-card.js:351)
    at scheduler-card.js:351
    at Array.some (<anonymous>)
    at Ts (scheduler-card.js:351)
    at scheduler-card.js:387
    at Array.every (<anonymous>)
    at scheduler-card.js:387
    at Array.every (<anonymous>)
    at scheduler-card.js:387
    at Array.forEach (<anonymous>)

scheduler-card.js:351

nielsfaber commented 3 years ago

This error seems related to your card config. Did you set up some custom groups or something else specific?

balbulator commented 3 years ago

yes, I created individual groups groups:

balbulator commented 3 years ago
  - title: Plan
    id: scheduler
    icon: mdi:calendar-clock

    cards:

      - type: custom:scheduler-card
        groups:
          - name: "Light"
            icon: ceiling-light
            include:
              - light
              - switch.sonoff_10007f0bca_1
              - switch.sonoff_10007f0bca_2

          - name: "Switch"
            icon: nintendo-switch
            include:
              - switch

          - name: "Vacuum"
            icon: robot-vacuum
            include:
              - vacuum

          - name: "Cover"
            icon: blinds
            include:
              - cover
              - script.blinds_down
              - script.blinds_up

          - name: "Sensors light"
            icon: weather-sunny
            include:
              - sensor.0x00158d00045fa2a5_illuminance
              - sensor.0x00158d00049fcfa6_illuminance
              - sensor.0x00158d00045f7a5a_illuminance
              - sensor.0x04cf8cdf3c776274_illuminance_lux
              - sensor.0x04cf8cdf3c7769e9_illuminance_lux
              - sensor.0x00158d00042cfb84_illuminance

          - name: "Sensors motion"
            icon: motion-sensor
            include:
              - binary_sensor.0x00158d00045fa2a5_occupancy
              - binary_sensor.0x00158d00049fcfa6_occupancy
              - binary_sensor.0x00158d00045f7a5a_occupancy
              - binary_sensor.0x00158d000461cebf_occupancy
              - binary_sensor.0x00158d00042cfb84_occupancy

          - name: "Sensors windows"
            icon: window-closed
            include:
              - binary_sensor.0x00158d00045c15f3_contact
              - binary_sensor.0x00158d00049fb06c_contact
              - binary_sensor.door_window_sensor_158d0004314266
              - binary_sensor.door_window_sensor_158d00049fdc76
              - binary_sensor.0x00158d00049fb4dd_contact

          - name: "Sensors temperature"
            icon: thermometer
            include:
              - sensor.0x00158d00045bd991_temperature
              - sensor.0x00158d0004210d2d_temperature
              - sensor.temperature_158d00045c2ea8
              - sensor.0x00158d0004657cc6_temperature

          - name: "Sensors humidity"
            icon: water-percent
            include:
              - sensor.0x00158d00045bd991_humidity
              - sensor.0x00158d0004210d2d_humidity
              - sensor.humidity_158d00045c2ea8
              - sensor.0x00158d0004657cc6_humidity
balbulator commented 3 years ago

But it was like this from the start and it worked great.

ASNNetworks commented 3 years ago

I had the same issue, I reverted back which solved it. Clearing cache did not solve it. I will try again, perhaps because variables have change, it now doesn't load with old settings. Though I did double check and I don't use any changed settings, so it should work fine. I will report back once I have had time to test more.

Currently running 2.0.5 version.

This is my config btw:

              - title: false
                time_step: 5
                standard_configuration: true
                display_options:
                  icon: entity
                groups:
                  - name: "Schakelaars"
                    icon: hexagon-multiple
                    include:
                      - cover
                      - climate
                  - name: "Verlichting"
                    icon: lightbulb
                    include:
                      - light.*_lamp_*
                      - light.*_z_*
                      - light.*_ledstrip_*
                    exclude:
                      - light.badkamer_*
                      - light.wc_*
                      - light.gang_*
                      - light.keuken_*
                      - light.hal_*        
                      - light.*_1
                      - light.*_2
                      - light.*_3
                      - light.*_4                   
                  - name: "Entertainment"
                    icon: youtube-tv
                    include:
                      - media_player.woonkamer_tv
                      - switch.kantoor_pc
                  - name: "Muziek"
                    icon: music
                    include:
                      - media_player.*_lms                            
                  - name: "Scènes"
                    icon: auto-fix
                    include:
                      - input_boolean.scene_film
                      - input_boolean.scene_slaap
                      - input_boolean.scene_opstaan
                      - input_boolean.scene_game
                      - input_boolean.muziek_scene
                      - input_boolean.scene_diner                           
                include:
                  - light.*_lamp_*
                  - light.*_ledstrip_*
                  - light.*_z_*
                  - input_boolean.scene_film
                  - input_boolean.scene_slaap
                  - input_boolean.scene_opstaan
                  - input_boolean.scene_game
                  - input_boolean.muziek_scene
                  - input_boolean.scene_diner
                  - media_player.woonkamer_tv
                  - cover
                  - media_player.*_lms
                exclude:
                  - switch.woonkamer_*
                  - switch.badkamer_*
                  - switch.kantoor_pc_w
                  - light.badkamer_*
                  - light.wc_*
                  - light.gang_*
                  - light.keuken_*
                  - light.hal_*
                  - light.*_1
                  - light.*_2
                  - light.*_3
                  - light.*_4                          
                customize:
                  light.woonkamer_salon_plafond_group:
                    name: Salon Plafond
                  light.kantoor_plafond:
                    name: Kantoor Plafond        
                  light.slaapkamer_plafond:
                    name: Slaapkamer Plafond 
                  light.woonkamer_eettafel_plafond:
                    name: Eettafel                             
                  light.woonkamer_z_lampen:
                    name: Woonkamer Lampen
                  light.kantoor_z_lampen:
                    name: Kantoor Lampen
                  light.slaapkamer_z_lampen:
                    name: Slaapkamer Lampen                                       
                type: 'custom:scheduler-card' 
                style:
                  $: |
                    element.style {
                    }                          
                    mwc-button.warning {
                      --mdc-theme-primary: #FFFFFF;
                      background: var(--media-accent-color);
                    }                        
nielsfaber commented 3 years ago

I'm quite sure you have found a bug due to changes I've done in my code. I (and many others) don't define their own groups, I will run some tests myself to catch the problem.

nielsfaber commented 3 years ago

It seems like i made the exclude declaration mandatory for each group. I was able to reproduce (and fix) the problem by adding it manually:

groups:
  - name: "my group"
    include:
      - switch.my_entity
      - ...
    exclude: [] # add this line as quick-fix

If you want to run the latest version you could add it manually (for each group).

Ofcourse I will plan a release to fix this problem.

nielsfaber commented 3 years ago

FYI: fix is on its way https://github.com/nielsfaber/scheduler-card/commit/08856ac58f81ca74fd02cdb2e7088121fece63c8

balbulator commented 3 years ago

I made corrections while everything works Thank you for your willingness to help

jortegamx commented 3 years ago

Thanks @nielsfaber I'm having a strange issue with the upgrade. It was working fine and now it says that I should install as an integration the scheduler component but is it installed as an integration, if I reinstall the card appears but when I press the ADD button it just goes away.

nielsfaber commented 3 years ago

@jortegamx i have heard from others the same issue. So far I don’t have a clue what causes this. The error suggests a problem with the connection to the backend (scheduler-component). Do you have some schedules running and do they show up fine in Developer Tools -> States? You say the card goes away (disappears?) when you click ADD? Anything printed in the browser logs when this happens?

jortegamx commented 3 years ago

Nothing in the logs, the schedules show in the integration and in states, they still run but does not show. If I delete the integration then the schedules are deleted too. When I press the ADD it literally disappear like if it was a conditional card.

nielsfaber commented 3 years ago

@jortegamx If you would like to help me with troubleshooting the issue, please update your local scheduler-card installation to the attached file. It should be placed in www/community/scheduler-card in case you use HACS, otherwise you probably know the location yourself. After overwriting the .js file, reload the frontend resources (click "reload resources" on the top right menu in HA lovelace). Please check your browser logs, if the update went right it should show this badge: image

Now I would like you to share what is shown in the browser logs when:

  1. You get the message "install scheduler-component as integration"
  2. You click "ADD" and the card disappears

Thanks in advance!

scheduler-card.zip

jortegamx commented 3 years ago

I've made the replacement but it keeps showing the other version 2.1.1, I've restarted the instance just in case, is there anything else I should do? I'm pretty sure I've changed the file (Tried renaming the old one, deleting it etc.)
image

nielsfaber commented 3 years ago

@jortegamx could you clear your browser cache, switch to another browser, or something like it? Sometimes making a small change to the ui-lovelace also helps to refresh the cache.

jortegamx commented 3 years ago

Ready! Now its showing Version: Test, so which logs do you need? It's working, the "install scheduler-component as integration" message disappeared and the card no longer disappear when ADD button is pressed.

nielsfaber commented 3 years ago

@jortegamx I didn’t fix anything yet. The test version was only to give more debugging information so I would have a starting point for investigating. If the problem is now fixed anyway that is very strange to me. Maybe you could keep it like this for one or two days, see if you might catch the issue at some point?

jortegamx commented 3 years ago

Sure, I have been doing tests but I have a super random behavior. The problem triggers when upgrading to core-2021.4.6. If I upgrade the scheduler component before the core everything goes well, on the other side it goes wrong and shows the "install scheduler-component as integration" message. If I have other frontend custom components such as button card or mini media player the problem persists in either update way.

miki3421 commented 3 years ago

Same problem here! Let me know how I can help.

nielsfaber commented 3 years ago

I made a release v2.1.2 which includes some internal improvements. I don't think any of them will really tackle the problem, but it's better than running v2.1.1. If you have a problem with the "install scheduler-component as integration" message popping up, it's best to keep using the version I posted earlier (https://github.com/nielsfaber/scheduler-card/issues/374#issuecomment-832416368) and catch what's in the browser logs when it occurs.

jortegamx commented 3 years ago

Thanks @nielsfaber !

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

kaizersoje commented 3 years ago

message to avoid stale.

nielsfaber commented 3 years ago

@kaizersoje I think this issue is stale. No one can provide me any details to reproduce this problem, so I cannot help. Open a new issue if you have a problem.